Showing posts with label MySQL. Show all posts
Showing posts with label MySQL. Show all posts

Thursday, 11 June 2009

"Client does not support authentication protocol requested by server; consider upgrading MySQL client"

Did you just upgrade MySQL and got the error message:
Client does not support authentication protocol requested by server; consider upgrading MySQL client.
MySQL 5.1+ uses an authentication protocol that is incompatible with older clients. The best solution is probably to upgrade your mysql client, but there is a quick an dirty fix if want to continue using your old client: You can reset the password to the pre-4.1 format for each user that needs to use an old client program:

mysql> SET PASSWORD FOR 'username'@'localhost' = OLD_PASSWORD('thepassword');

More information available here:
http://dev.mysql.com/doc/refman/5.1/en/old-client.html

Wednesday, 29 April 2009

How to create a new MySQL database and user from the command prompt

1. Start mysql.exe, the MySQL monitor:
C:\Program Files\mysql\mysql-5.0.77-win32\bin> mysql.exe -h localhost --user=root -p
2. Create the user and set the password:
mysql> CREATE USER theusername@localhost IDENTIFIED BY 'thepassword';
3. Make sure the new user appear in the user table:
mysql> SELECT * FROM mysql.user;
4. Create the database:
mysql> CREATE DATABASE yourdatabase;
5. Make sure your database was created:
SHOW DATABASES;
6. Grant all privileges for your new database to your user:
mysql> GRANT ALL ON yourdatabase.* to theusername@localhost;
7. Done. Now you got a new database and a new user with all privileges.