OC

Knowledge OS
登录 注册
全部话题 移民 创业 iOS Mac Objective-C Swift Android 招聘 求职

OS X 10.10 如何正确安装Mysql?

Gavin
Gavin 发布于 2014年11月29日 | 更新于 2014年11月30日
无人欣赏。

我安装出来的没有user表,这可怎么搞?

官网下载的:mysql-5.6.21-osx10.9-x86_64.dmg ,打开正常安装。

mysql 进入控制台 show databases; 发现没有mysql数据库。

尝试卸载重装 卸载方法:http://www.cnblogs.com/TsengYuen/archive/2011/12/06/2278574.html

还是不能解决问题。


是我SB了, 应该指定用户进入控制台的 mysql -u root ,直接mysql 进去是没有权限的。。。

共5条回复
楼长 ·
tinyfool 回复于 2014年11月30日

学会问问题的方法,你是怎么安装的,说清楚,没有user表你是怎么查的,列出来

2楼 ·
stoneshao 回复于 2014年11月30日

没有user表怎么连上的?第一次安装的mysql会有三个数据库,其中有个mysql的库,查一下即可。


  1. mysql -uroot -p
  2. use mysql;
  3. show tables;
  4. select host,user from user;
3楼 ·
Gavin 回复于 2014年11月30日

2楼 @stoneshao 确实是没有啊,没有mysql 这个数据库的。

MacBook-Pro:~ Gavin$ mysql
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 4
Server version: 5.6.21 MySQL Community Server (GPL)
Copyright (c) 2000, 2014, 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> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| test |
+--------------------+
2 rows in set (0.01 sec)
mysql> 
4楼 ·
Gavin 回复于 2014年11月30日

2楼 @stoneshao 刚刚尝了下,sudo mysql这样进去能有mysql数据库,这可如何是好啊?

5楼 ·
Gavin 回复于 2014年11月30日

2楼 @stoneshao 我错了,解决了。。。

登录 或者 注册

AltStyle によって変換されたページ (->オリジナル) /