重置密碼和資料庫(适合源碼安裝,rpm的可能不行)
[root@mail postfixadmin]# /usr/bin/mysql_install_db --force
Installing all prepared tables
Fill help tables
To start mysqld at boot time you have to copy support-files/mysql.server
to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h mail.test.com password 'new-password'
See the manual for more instructions.
NOTE: If you are upgrading from a MySQL <= 3.22.10 you should run
the /usr/bin/mysql_fix_privilege_tables. Otherwise you will not be
able to use the new GRANT command!
You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &
You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
cd sql-bench ; perl run-all-tests
Please report any problems with the /usr/bin/mysqlbug script!
The latest information about MySQL is available on the web at
<a href="http://www.mysql.com/">[url]http://www.mysql.com[/url]</a>
2. cp support-files/mysql.server /etc/init.d/mysql(源碼路徑)
3 ./usr/bin/mysqld_safe &
4./etc/init.d/mysql start
5 mysqladmin -u root password "new password"
解決root關于本機登陸可以,遠端同樣密碼帳戶無法用mysql administrator連接配接
在使用MySQL-Front連接配接mysql的時候發生的這個錯誤
ERROR 1130: Host 192.168.88.160 is not allowed to connect to this MySQL server
mysql -u root -p
mysql>use mysql;
mysql>update user set host = ‘%’ where user =’root’;
mysql>flush privileges;
mysql>select ‘host’,'user’ from user where user=’root’;
現在就可以連接配接了!
2. 授權法。例如,你想myuser使用mypassword從任何主機連接配接到mysql伺服器的話。
如果你想允許使用者myuser從ip為192.168.1.3的主機連接配接到mysql伺服器,并使用mypassword作為密碼
本文轉自 pgmia 51CTO部落格,原文連結:http://blog.51cto.com/heyiyi/112959