Mysql 缺失的数据库
当我用usr/sbin/mysqld启动mysql服务器——跳过授权表——user=mysql&(debian 7)并登录到mysql时,show databases查询结果如下:Mysql 缺失的数据库,mysql,debian,Mysql,Debian,当我用usr/sbin/mysqld启动mysql服务器——跳过授权表——user=mysql&(debian 7)并登录到mysql时,show databases查询结果如下: mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | UDA | | guikuzi
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| UDA |
| guikuzi |
| hotel_guregas |
| merkaklub |
| mysql |
| performance_schema |
| phpmyadmin |
| superlinea |
| test |
+--------------------+
10 rows in set (0.00 sec)
这是一个信息:
mysql> SHOW VARIABLES WHERE Variable_Name LIKE "%dir";
+---------------------------+----------------------------+
| Variable_name | Value |
+---------------------------+----------------------------+
| basedir | /usr |
| character_sets_dir | /usr/share/mysql/charsets/ |
| datadir | /var/lib/mysql/ |
| innodb_data_home_dir | |
| innodb_log_group_home_dir | ./ |
| lc_messages_dir | /usr/share/mysql/ |
| plugin_dir | /usr/lib/mysql/plugin/ |
| slave_load_tmpdir | /tmp |
| tmpdir | /tmp |
+---------------------------+----------------------------+
9 rows in set (0.00 sec)
在此之后,如果我停止此mysql服务器并通过/etc/init.d/mysql start启动,我会看到:
# /etc/init.d/mysql start 3 ↵
[ ok ] Starting mysql (via systemctl): mysql.service.
[root@debian:~]
# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 47
Server version: 5.5.35-0+wheezy1 (Debian)
Copyright (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> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| test |
+--------------------+
2 rows in set (0.01 sec)
mysql> SHOW VARIABLES WHERE Variable_Name LIKE "%dir";
+---------------------------+----------------------------+
| Variable_name | Value |
+---------------------------+----------------------------+
| basedir | /usr |
| character_sets_dir | /usr/share/mysql/charsets/ |
| datadir | /var/lib/mysql/ |
| innodb_data_home_dir | |
| innodb_log_group_home_dir | ./ |
| lc_messages_dir | /usr/share/mysql/ |
| plugin_dir | /usr/lib/mysql/plugin/ |
| slave_load_tmpdir | /tmp |
| tmpdir | /tmp |
+---------------------------+----------------------------+
发生了什么事?我启动了安全模式,因为我必须重置根密码,但它也不起作用。现在我有我的服务器在安全模式,它正在工作,但我认为这不是最好的方式
有什么帮助或线索吗
提前感谢根据您的帖子,很明显,您首先启动了MySQL服务器,但没有打开其特权系统(--skip grant tables)。此选项关闭MySQL的内部特权系统,任何人都可以不受限制地访问所有数据库。因此,当您通过客户端连接到数据库服务器时,您绕过了任何权限检查,可以查看所有数据库 --跳过授权表此选项会导致服务器在根本不使用特权系统的情况下启动,从而使任何人都可以访问 服务器不受限制地访问所有数据库。 " 有关更多信息,请参阅 在第二个实例中,您启动了MySQL正常情况下,权限系统是打开的,这意味着连接用户可以根据其身份执行允许他们执行的操作 MySQL特权系统确保所有用户只能执行 作为用户,当您连接到MySQL时 服务器,您的身份由您连接的主机确定 以及您指定的用户名。当您在 连接时,系统会根据您的身份授予权限 你想做什么 请参阅中的更多信息 另外,请看一看如何查看哪个用户已通过您当前的MySQL会话的身份验证的答案 更简单的是,只需键入“\s”,即可在MySQL客户端提示符中查看基本状态信息。例如:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 38
Server version: 5.5.35-0ubuntu0.13.10.2 (Ubuntu)
Copyright (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> \s
--------------
mysql Ver 14.14 Distrib 5.5.35, for debian-linux-gnu (x86_64) using readline 6.2
Connection id: 37
Current database:
Current user: ubuntu@localhost
(...)
我希望以上内容能有所帮助。我试图向您展示一个基本的指针,告诉您如何解决这种情况