配置mysql密码出现错误解决方案
2012-06-01 12:54
309 查看
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
[root@twinkle ~]# /etc/init.d/mysqld stopStopping MySQL: [ OK ]
[root@twinkle ~]# mysqld_safe --skip-grant-tables &
[1] 13694
[root@twinkle ~]# Starting mysqld daemon with databases from /var/lib/mysql
[root@twinkle ~]# mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.77 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> update user set password=PASSWORD("testpass") where User='root';
ERROR 1046 (3D000): No database selected
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| test |
+--------------------+
3 rows in set (0.13 sec
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> show tables;
+---------------------------+
| Tables_in_mysql |
+---------------------------+
| columns_priv |
| db |
| func |
| help_category |
| help_keyword |
| help_relation |
| help_topic |
| host |
| proc |
| procs_priv |
| tables_priv |
| time_zone |
| time_zone_leap_second |
| time_zone_name |
| time_zone_transition |
| time_zone_transition_type |
| user |
+---------------------------+17 rows in set (0.00 sec)
mysql> update user set password=PASSWORD("testpass") where User='root';
Query OK, 3 rows affected (0.05 sec)Rows matched: 3 Changed: 3 Warnings: 0
mysql> flush privileges; Query OK, 0 rows affected (0.04 sec)mysql> quit
Bye
[root@twinkle ~]# /etc/init.d/mysql restart
bash: /etc/init.d/mysql: No such file or directory[root@twinkle ~]# /etc/init.d/mysqld restart
STOPPING server from pid file /var/run/mysqld/mysqld.pid101120 04:17:15 mysqld endedStopping MySQL: [ OK ]Starting MySQL: [ OK ][1]+ Done mysqld_safe --skip-grant-tables
[root@twinkle ~]# mysql -u root -pEnter password: Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 2Server version: 5.0.77 Source distributionType 'help;' or '\h' for help. Type '\c' to clear the buffer.mysql> quitBye[root@twinkle ~]#
相关文章推荐
- centos 下刚安装完MySQL就出现密码错误 Access denied for user 'root'
- Word编程出现ComException错误:系统配置类型不正确,系统无法开始服务器进程,请检查用户名,密码
- mysql配置目录错误:在安装mysql 5.6.19 时执行cmake命令是出现CMake Error: The source directory does not appear to contai
- 检索 COM 类工厂中 CLSID 为 {00024500-0000-0000-C000-000000000046} 的组件失败,原因是出现以下错误: 8000401a 因为配置标识不正确,系统无法开始服务器进程。请检查用户名和密码。 (异常来自 HRESULT:0x8000401A)。 在 BatchImportEntryTable.GetExcelData(String FileName)
- win7 安装oralce10g 出现未知错误、网络配置未执行的问题及解决方案
- MAC上Mysql忘记Root密码或权限错误的快速解决方案
- 安装PostgreSQL出现“Invalid username specified:登录失败:未知的用户名和错误密码。”和“The specified data directory is not empty.”错误的解决方案
- 运行phpmyadmin的时候下方总是出现“wapm您配置文件中的设置 (空密码的 root) 与 MySQL 默认管理员账户对应。您的 MySQL 服务器使用默认值运行
- navicat连接mysql时出现1045错误的解决方法,修改root密码
- mysql遇到load data导入文件数据出现1290错误的解决方案
- Oracle配置时密码错误解决方案
- JBoss中配置数据源出现错误:“Failed to register driver for: com.mysql.jdbc.Driver”的解决方法
- mysql出现1067异常或1366错误的解决方案(字符集冲突导致插入数据异常)
- MAC上Mysql忘记Root密码或权限错误的快速解决方案
- Spring boot配置的事务失效,出现错误数据不回滚解决方案
- JBoss中配置数据源出现错误:“Failed to register driver for: com.mysql.jdbc.Driver”的解决方法
- JSP连接MySQL时出现--错误:Access denied for user 'root'@'localhost' (using password: YES)'解决方案
- 安装 mysql时如果出现密码错误
- Mysql连接错误:Access denied for user 'root'@'localhost' (using password:YES)解决方案以及WINDOWS下修改Mysql密码
- 关于在乌班图中出现Authenticaton is required to "mysql_server"输入密码总是错误解决