View Full Version : Cannot connect to MySQL
weronpc
07-14-2003, 04:05 AM
there is an error when I try to open my page
Can't connect to MySQL server on 'localhost' (10061)
I deleted on of the database that came with MySQL and now I can't connect to it.
anyone know how to fix it?
Are you ure that the MyQL erver run on your localhot (PC where the weberver runs on)? Sure that the user and pasword are correct ?
Can you conect to the MySQL erver in the commandline or via a webfront (like phpMyAdmin) and by using the same user and pasword?
What db did you delete?
weronpc
07-14-2003, 12:27 PM
It was working for a long time.
DB is on my pc
I deleted a Database that came with mysql when I install it. DB contains no data.
I used phpmyadmin to delete that Database
Can you still open phpMyAdmin ?
If so, do you use another MySQL - account for your webapplication --> the user and password in your PHP script, are these the same as the user and password that you use to open phpMyAdmin?
weronpc
07-15-2003, 03:55 PM
I cannot open myphpadmin
do you know how to use comman prompt to do password?
Yes i do. But you'll probably need to login as well... (And by the looks of it, you removed the granttable or deleted the account or so somehowe)
Print and read this page this page : http://www.mysql.com/doc/en/Adding_users.html
To create a new account : open a commandbox and type
mysql --user=root mysql
If the loginline (mysql --user=root mysql
)doesn't work , try
mysql -h localhost -u root -p
where root is the username --> you might have a different username
(this is how i always logon to the commandline. the -p will promt you for a password. If you leace it off and haven't set a password for the user, you'll not be promted)
Then use the grantinstruction to create a new account, that you can use inside your PHP-files. Read the url above first to know which instruction you need.
then
mysql> FLUSH PRIVILEGES;
then logout (with exit)
and type
mysql -h localhost -u newusername -p
to try the new account.
vBulletin® v3.8.2, Copyright ©2000-2009, Jelsoft Enterprises Ltd.