Tech blog

Solving problems

About
Contact

Archive for the ‘mysql’ tag

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

leave a comment

If you got this strange message on MySQL:

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

Then you will need to do the following:

  1. Start DOS mysql script manager with command (I assume that you put MySQL/bin to the PATH enviroment variable):
    mysql -u [dbusername] -p, where dbusername is username for your database
  2. Enter your current password and you will get mysql > prompt
  3. Type:
    SET PASSWORD = OLD_PASSWORD(‘MyPassword’);
  4. Type:
    FLUSH PRIVILEGES;

And thats it!

VN:F [1.9.3_1094]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.3_1094]
Rating: 0 (from 0 votes)

MySql dump, tar, restore…

2 comments

Very often you need to migrate your MySQL database from one server to another, from Windows to Linux, Linux to Linux….

So, first you need to create dump of your existing database, to export it to a file. Here is the command:

mysqldump -P 3306 -u database_username -p database_name > /home/somedirectory/your_database.sql

-P - means port, if you don’y mention it default port is used (usually 3306)
-u – means database username
-p – means password but we didn’t specified it so after this command is executed we will be asked to type a password
database_name
– is the name of your database you want to export
> location – at the end you specify directory where you want to create this dump

You probably want to zip this and you can use TAR (install Cygwin if working on Windows):
Here is the command:

tar cvf database.tar /home/somedirectory/your_database.sql

Transfer this file on other server using FTP… And unzip it if you want using command:

tar -xvf database.tar

Then import the database:

mysql -P 3306 -u  database_username -p new_existing_database_name < /home/somedirectory/public_ftp/your_database.sql

-P - means port, if you don’y mention it default port is used (usually 3306)
-u – means database username
-p – means password but we didn’t specified it so after this command is executed we will be asked to type a password
new_existing_database_name
– is the name of your existing database on new server where you want to import data
< location – at the end you specify from which directory you want to import database

And thats it…

VN:F [1.9.3_1094]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.3_1094]
Rating: 0 (from 0 votes)

Written by Avivo

February 25th, 2009 at 10:27 am