Main

décembre 29, 2003

How do upload an existing mysql database?

Use mysqldump. % mysqldump -h old.db.server.com -u old_user -p old_database > data.sql [enter password] To reimport into a blank database: % mysql -h db.sabren.com -u user -p database < data.sql [enter password]

décembre 01, 2003

Mysql Secure Installation

See that "link":http://jeremy.zawodny.com/blog/archives/001137.html

octobre 30, 2003

Add host to Mysql (connect remotely)

Use the MySQL monitor to insert a new row into the host and user tables as follows.

1. Log in and start the MySQL monitor with this command:

/usr/local/mysql/bin/mysql

2. Run this command:

mysql> use mysql;

3. Add the user's host IP address to the host table:

mysql> INSERT INTO host VALUES
('[HOST_IP_ADDRESS]','%','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');

Replace [HOST_IP_ADDRESS] with the I.P. of the location you want to be able to connect from.

4. Add the user's IP address, user ID, and password to the user table:

mysql> INSERT INTO user VALUES
('[HOST_IP_ADDRESS]','[USER]',PASSWORD('[PASSWORD]'),
'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');

Replace [HOST_IP_ADDRESS] with the same I.P. from above, [PASSWORD] with your password, and [USER] with your username.

5. Restart MySQL

MySQL Restore

Dumping and Restoring MySQL Database Manually Restoring Database mysql -uu777_database -pPASSWORD \ u777_database < u777_database.sql gunzip < u777_database.sql.gz | \ mysql -uu777_database -pPASSWORD \ u777_database