darkfreaks Posted November 17, 2010 Share Posted November 17, 2010 i think this has to do something with me dropping my table and trying to reinstall the blog but now i get "can't connect to mysql5.000webhost.com" so then i tried using localhost and i get... "can't connect to localhost using password YES" so i assume my password is right and for some reason it isnt connecting yet all the variables match up correct password, database,user i double and triple checked spelling Quote Link to comment https://forums.phpfreaks.com/topic/219000-help-with-mysql_connect/ Share on other sites More sharing options...
ManiacDan Posted November 17, 2010 Share Posted November 17, 2010 "can't connect hostname.domain.com" isn't a standard error, you should echo the real error. Your password isn't necessarily correct. Why do you believe this host (or your local machine) have MySQL installed and running? -Dan Quote Link to comment https://forums.phpfreaks.com/topic/219000-help-with-mysql_connect/#findComment-1135742 Share on other sites More sharing options...
darkfreaks Posted November 17, 2010 Author Share Posted November 17, 2010 it worked fine until i dumped the table. my database information is correct. i made sure of this numerous times. Quote Link to comment https://forums.phpfreaks.com/topic/219000-help-with-mysql_connect/#findComment-1135750 Share on other sites More sharing options...
ManiacDan Posted November 17, 2010 Share Posted November 17, 2010 When you say "the table," what do you mean? The whole database? One table? All tables? Some tables? Quote Link to comment https://forums.phpfreaks.com/topic/219000-help-with-mysql_connect/#findComment-1135777 Share on other sites More sharing options...
Pikachu2000 Posted November 17, 2010 Share Posted November 17, 2010 And when you say "dumped" do you mean exported, truncated, dropped, or . . . ? Quote Link to comment https://forums.phpfreaks.com/topic/219000-help-with-mysql_connect/#findComment-1135782 Share on other sites More sharing options...
darkfreaks Posted November 17, 2010 Author Share Posted November 17, 2010 i dropped everything from the table. Quote Link to comment https://forums.phpfreaks.com/topic/219000-help-with-mysql_connect/#findComment-1135785 Share on other sites More sharing options...
darkfreaks Posted November 17, 2010 Author Share Posted November 17, 2010 also should i include the prefix the phpmyadmin adds in like 238282892ddsd_user or would user be better? Quote Link to comment https://forums.phpfreaks.com/topic/219000-help-with-mysql_connect/#findComment-1135793 Share on other sites More sharing options...
herghost Posted November 17, 2010 Share Posted November 17, 2010 generally: $host = localhost $username = siteusername_databaseusername (eg. mysite_admin) $password = yourpassword $database = siteusername_databasename(eg mysite_mydatabase) Quote Link to comment https://forums.phpfreaks.com/topic/219000-help-with-mysql_connect/#findComment-1135796 Share on other sites More sharing options...
ManiacDan Posted November 17, 2010 Share Posted November 17, 2010 i dropped everything from the table.This sentence is invalid. You can either DROP a table, or DELETE everything from the table. You cannot "drop" data, only tables. What query did you run? What button did you push? If you're saying you deleted the table "users' under the database "mysql," then you've deleted your own accounts. You cannot log in without a user table. -Dan Quote Link to comment https://forums.phpfreaks.com/topic/219000-help-with-mysql_connect/#findComment-1135798 Share on other sites More sharing options...
darkfreaks Posted November 17, 2010 Author Share Posted November 17, 2010 mine is more like this define ('DB_USER', '****'); define ('DB_PASSWORD', '****'); define ('DB_HOST', '****'); define ('DB_NAME', '****'); $dbc = mysql_connect (DB_HOST, DB_USER, DB_PASSWORD) OR die('Could not connect to MySQL: ' . mysql_error()); mysql_select_db (DB_NAME) OR die('Could not select the database: ' . mysql_error()); also i recreated the table deleted it hoping it would just bring up the setup file but i still get connect errors Quote Link to comment https://forums.phpfreaks.com/topic/219000-help-with-mysql_connect/#findComment-1135801 Share on other sites More sharing options...
darkfreaks Posted November 17, 2010 Author Share Posted November 17, 2010 Could not connect to MySQL: Lost connection to MySQL server at 'reading initial communication packet', system error: 113 Quote Link to comment https://forums.phpfreaks.com/topic/219000-help-with-mysql_connect/#findComment-1135816 Share on other sites More sharing options...
darkfreaks Posted November 17, 2010 Author Share Posted November 17, 2010 i'm going to close this for now seems to be a connection issue with there MYSQL server from what i gather. Quote Link to comment https://forums.phpfreaks.com/topic/219000-help-with-mysql_connect/#findComment-1135817 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.