三 Mariadb的root密码的重新设置
首先停止数据库服务器进程:
- # service mysql stop
安全模式启动:
- # mysqld_safe --skip-grant-tables &
登录MariaDb server:
- # mysql -u root
- Welcome to the MariaDB monitor. Commands end with ; or \g.
- Your MariaDB connection id is 1
- Server version: 5.5.32-MariaDB MariaDB Server
- Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others.
- Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
设置密码:
- MariaDB [(none)]> update mysql.user set password=PASSWORD("newpassword") where User='root';
- Query OK, 4 rows affected (0.00 sec)
- Rows matched: 4 Changed: 4 Warnings: 0
授权后退出:
- MariaDB [(none)]> flush privileges;
- Query OK, 0 rows affected (0.00 sec)
- MariaDB [(none)]> exit;
- Bye
重新启动数据库进程:
- # service mysql restart
使用新密码登录:
- # mysql -u root -p
- Enter password:
- Welcome to the MariaDB monitor. Commands end with ; or \g.
- Your MariaDB connection id is 1
- Server version: 5.5.32-MariaDB MariaDB Server
- Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others.
- Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
总结:
MariaDB 基本上名门之后,加上MySQL创始人Monty的实力和号召力,是作为MySQL一个非常好的替代品, 前途发展无限,值得我们尝试使用。二者的常用工具,连接程序都可以如常运作。你也不需要导出和汇 入数据。格式与文件名都是相同的。 |