1、修改密码因为默认是没有密码的为了安全先修改密码,方法是:先停止mysql/etc/init.d/mysql stop-- 安全模式启动[root@mysql
1、修改密码
因为默认是没有密码的为了安全先修改密码,方法是:
先停止mysql
/etc/init.d/mysql stop
-- 安全模式启动
[root@mysql var]#mysqld_safe --skip-grant-tables &
[1] 10912
[root@mysql var]# 110407 17:39:28 mysqld_safe Logging to '/usr/local/mysql/var//mysql.chinascopefinanical.com.err'.
110407 17:39:29 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var/
[root@mysql var]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 48
Server version: 5.1.41-log Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> use mysql;
Database changed