关于mysql数据库不出现名为mysql数据库的解决办法
2015-11-16 13:01
513 查看
关于mysql数据库不出现名为mysql数据库的解决办法
另外该方法同样可ERROR 1045 (28000): Access denied for user ‘melina’@’localhost’ (using password: YES)类型的错误
首先用root权限执行 /etc/init.d/mysqld stop 停止mysql服务器接着执行 # mysqld_safe –skip-grant-tables & 确定服务器已停止,出现如下信息:
[1] 16071
# 151116 12:38:56 mysqld_safe Logging to ‘/var/log/mysqld.log’.
151116 12:38:56 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
看到上面的结果后,输入mysql -u melina 出现下面结果:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.73 Source distributionCopyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
mysql>
输入use mysql,切换到mysql数据库
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
5.执行更新密码
mysql>update user set password=password(“root”) where user=”root”;
Query OK, 4 rows affected (0.00 sec)
Rows matched: 4 Changed: 4 Warnings: 0
mysql> commit;
Query OK, 0 rows affected (0.00 sec)
mysql> exit;
Bye
退出后输入如下命令启动:mysql -uroot,如下:
# mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.1.37-1ubuntu5.5 (Ubuntu)
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
mysql>
6.然后输入show databases;
mysql> show dataabses;
应该会出现mysql数据库
相关文章推荐
- mysql_navicat-permium 在Mac下破解方法
- MySQL调优系列基础篇
- LoadRunner Mysql性能优化
- MySQL 中隔离级别 RC 与 RR 的区别
- Mysql 数据库 ERROR 1044(42000)
- [MySQL FAQ]系列 — 为什么InnoDB表要建议用自增列做主键
- mysql数据库常用语句系列
- MySQL和Gbase中information_schema是什么
- mysql密码修改
- mysql Error Code:1175
- MySQL关键字(保留字)列表
- 【转】mysql行列转换方法总结
- mysql 数据插入优化方法
- navicat for mysql注册码
- MySQL字段类型详解
- mysql安装图解
- MySql学习笔记----索引,外键
- configure: error: Cannot find libmysqlclient under /usr.
- MySQL存储引擎--MyISAM与InnoDB区别
- 记一次使用Cobar踩到的坑