N5ken's technical blog

Just another WordPress.com site

Tag Archives: MySQL

Uninstalling MySQL on Mac OS X Leopard

To uninstall MySQL and completely remove it (including all databases) from your Mac do the following:

Use mysqldump to backup your databases to text files!
Stop the database server
sudo rm /usr/local/mysql
sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
edit /etc/hostconfig and remove the line MYSQLCOM=-YES-
rm -rf ~/Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*

The last two lines are particularly important as otherwise, you can’t install an older version of MySQL even though you think that you’ve completely deleted the newer version!

Remote accessing to MySQL

For the original post, please visit:

http://blog.csdn.net/n5ken/archive/2008/08/25/2825378.aspx

1. Firstly, login to MySQL by command line in your local machine, e.g.

root@ubuntu:~# mysql -u root -p

2. Executing the following command to grant the privileges

mysql> grant all on *.* to root@'%' identified by "root";

Here ‘all’ can be replaced by ‘select’, ‘update’, ‘insert’, ‘delete’ and so on.
*.* represent all databases and all tables
root@’%’ means all user root to access from every ip address, ‘%’ may replace by a specific ip address
identified by “root” means give user root a password “root” for login

3. After the step 2 done, you need to run “flush privileges;” to update your settings

To show the privileges you just configured, you can run

show grants for [your user name]

for example:

show grants for root@'localhost';
Follow

Get every new post delivered to your Inbox.