bighof Posted August 15, 2005 Share Posted August 15, 2005 I have switched hosts and cannot open th db. Here is what my host wrote may be the problem. It looks like you are using a incorrect mySQL server name. We do not run mySQL on localhost has many smaller hosts does ? we use a dedicated server for that (for performance and security). The mySQL hostname you should use is: mysql.servage.net or mysql2.servage.net, mysql3.servage.net or mysql4.servage.net. Where do I change the settings from localhost? Would I need to upload my saved current db to this server and NOT to the backup in admin or both? John Link to comment Share on other sites More sharing options...
bighof Posted August 15, 2005 Author Share Posted August 15, 2005 I forgot to add this message I get when I try to open the shop. I have transfered folders for a site and a mySQL DB. When I try to open the page I get the following error. Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /mounted-storage/home6/sub001/sc12855-XAJI/www/osCommerce/includes/functions/database.php on line 19 Unable to connect to database server! Here are lines 13 - 25 . function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') { global $$link; if (USE_PCONNECT == 'true') { $$link = mysql_pconnect($server, $username, $password); } else { $$link = mysql_connect($server, $username, $password); } if ($$link) mysql_select_db($database); return $$link; } I have switched hosts and cannot open th db.Here is what my host wrote may be the problem. It looks like you are using a incorrect mySQL server name. We do not run mySQL on localhost has many smaller hosts does ? we use a dedicated server for that (for performance and security). The mySQL hostname you should use is: mysql.servage.net or mysql2.servage.net, mysql3.servage.net or mysql4.servage.net. Where do I change the settings from localhost? Would I need to upload my saved current db to this server and NOT to the backup in admin or both? John <{POST_SNAPBACK}> Link to comment Share on other sites More sharing options...
Guest Posted August 15, 2005 Share Posted August 15, 2005 I forgot to add this message I get when I try to open the shop.I have transfered folders for a site and a mySQL DB. When I try to open the page I get the following error. Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /mounted-storage/home6/sub001/sc12855-XAJI/www/osCommerce/includes/functions/database.php on line 19 Unable to connect to database server! Here are lines 13 - 25 . function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') { global $$link; if (USE_PCONNECT == 'true') { $$link = mysql_pconnect($server, $username, $password); } else { $$link = mysql_connect($server, $username, $password); } if ($$link) mysql_select_db($database); return $$link; } <{POST_SNAPBACK}> Go to the 2 configure.php, and then change the last lines : define('DB_SERVER', 'xxxxxxx'); // eg, localhost - should not be empty for productive servers define('DB_SERVER_USERNAME', 'xxxxxxxx'); define('DB_SERVER_PASSWORD', 'xxxxxxxxx'); define('DB_DATABASE', 'xxxxxxxxx'); Link to comment Share on other sites More sharing options...
AlanR Posted August 15, 2005 Share Posted August 15, 2005 I have switched hosts and cannot open th db.Here is what my host wrote may be the problem. It looks like you are using a incorrect mySQL server name. We do not run mySQL on localhost has many smaller hosts does ? we use a dedicated server for that (for performance and security). The mySQL hostname you should use is: mysql.servage.net or mysql2.servage.net, mysql3.servage.net or mysql4.servage.net. Where do I change the settings from localhost? Would I need to upload my saved current db to this server and NOT to the backup in admin or both? John <{POST_SNAPBACK}> Like so (in both catalog/includes/configure.php and catalog/admin/includes/configure.php): define('DB_SERVER', 'mysql.servage.net); define('DB_SERVER_USERNAME', 'your_dbusername'); define('DB_SERVER_PASSWORD', 'your_dbpassword'); define('DB_DATABASE', 'your_dbname'); There's only one database associated with an osC install. You could import the old one to the new server using phpMyAdmin *or* the restore function in admin, the result is the same. Local: Mac OS X 10.5.8 - Apache 2.2/php 5.3.0/MySQL 5.4.10 • Web Servers: Linux Tools: BBEdit, Coda, Versions (Subversion), Sequel Pro (db management) Link to comment Share on other sites More sharing options...
bighof Posted August 15, 2005 Author Share Posted August 15, 2005 Like so (in both catalog/includes/configure.php and catalog/admin/includes/configure.php): define('DB_SERVER', 'mysql.servage.net); define('DB_SERVER_USERNAME', 'your_dbusername'); define('DB_SERVER_PASSWORD', 'your_dbpassword'); define('DB_DATABASE', 'your_dbname'); There's only one database associated with an osC install. You could import the old one to the new server using phpMyAdmin *or* the restore function in admin, the result is the same. <{POST_SNAPBACK}> I think I need to change the name of the db I imported, but how if needed. . At my new host I created a new db and put all the info as above. Here is what I get when I call the store, with the old db name bighof_osc1 1046 - No Database Selected select configuration_key as cfgKey, configuration_value as cfgValue from configuration [TEP STOP] And here is what I get when I use the name of my new created db 1146 - Table 'my_new_name.configuration' doesn't exist select configuration_key as cfgKey, configuration_value as cfgValue from configuration [TEP STOP] This is what I was given by the host when I created a new db. For your convenience we have included a small PHP example showing how to connect to the database: <?php $connection = mysql_connect("mysql4.servage.net", "UserName", "Password"); mysql_select_db("db_name", $connection); ?> Help what do I need to do??? Did I need to make a new db? When I go to the control I show no other dbs except the one I created. If I do not need a new db, then I can leave the db name, and password the same...right??? But will the password etc. be reconized? Will the db show up after I do a restore? I put the db in via the backup db onto my desktop and then ftp into the db backup file in the admin, so the db name is still the old name, BUT the db has not been restored as I get the same messages when I try to get into the osCommerce admin Link to comment Share on other sites More sharing options...
AlanR Posted August 15, 2005 Share Posted August 15, 2005 Help what do I need to do??? Did I need to make a new db? When I go to the control I show no other dbs except the one I created. If I do not need a new db, then I can leave the db name, and password the same...right??? <{POST_SNAPBACK}> If you see that db in your control panel just use that one. Import the data into it and adjust the configure.php files to match that db name and password. osC doesn't care what the db is named, it only cares about its contents. Local: Mac OS X 10.5.8 - Apache 2.2/php 5.3.0/MySQL 5.4.10 • Web Servers: Linux Tools: BBEdit, Coda, Versions (Subversion), Sequel Pro (db management) Link to comment Share on other sites More sharing options...
bighof Posted August 15, 2005 Author Share Posted August 15, 2005 If you see that db in your control panel just use that one. Import the data into it and adjust the configure.php files to match that db name and password. osC doesn't care what the db is named, it only cares about its contents. <{POST_SNAPBACK}> I will do that BUT another problem How do I import the db into the new one? To get it in I made a backup, put it on my desktop and then into the admin/backup/folder. Sorry but I have never done anything like this and need a little extra hand holding the first time. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.