MariaDB系列—Linux下设置MariaDB的初始密码(未完成)
大概很多小伙伴安装MariaDB后,登录数据库时都会遇到下面的情况:[root@mariadb-server-01 /]# /usr/local/mariadb/bin/mysqlERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)接下来说一下解决方法一、首先停掉数据库服务[root@m
·
大概很多小伙伴安装MariaDB后,登录数据库时都会遇到下面的情况:
[root@mariadb-server-01 /]# /usr/local/mariadb/bin/mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
接下来说一下解决方法
一、首先停掉数据库服务
[root@mariadb-server-01 /]# systemctl stop mariadb.service
[root@mariadb-server-01 /]# systemctl status mariadb.service
● mariadb.service - LSB: start and stop MySQL
Loaded: loaded (/etc/rc.d/init.d/mariadb; bad; vendor preset: disabled)
Active: inactive (dead) since 五 2017-12-08 12:36:56 CST; 2s ago
Docs: man:systemd-sysv-generator(8)
二、使用mysqld_safe来启动mysqld服务器
[root@mariadb-server-01 /]# /usr/local/mariadb/bin/mysqld_safe --defaults-file=/usr/local/mariadb-data/my.cnf --user=root --skip-grant-tables --skip-networking &
[1] 3552
[root@mariadb-server-01 /]# 171208 12:50:21 mysqld_safe Logging to '/usr/local/mariadb-data/mariadb-server-01.err'.
171208 12:50:21 mysqld_safe Starting mysqld daemon with databases from /usr/local/mariadb-data
附:配置过程中的问题
[root@mariadb-server-01 /]# /usr/local/mariadb/bin/mysqld_safe --user=root --skip-grant-tables --skip-networking &
[1] 3259
[root@mariadb-server-01 /]# 171208 12:38:13 mysqld_safe Logging to '/var/log/mysqld.log'.
171208 12:38:13 mysqld_safe A mysqld process already exists
[root@mariadb-server-01 /]# ps -ef | mysql
-bash: mysql: 未找到命令
[root@mariadb-server-01 /]# ps -ef | grep mysql
root 2227 1 0 09:27 pts/0 00:00:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/data/mysql/data --pid-file=/data/mysql/data/mariadb-server-01.pid
mysql 2442 2227 0 09:27 pts/0 00:00:03 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/data/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/var/log/mysqld.log --pid-file=/data/mysql/data/mariadb-server-01.pid --socket=/tmp/mysql.sock --port=3306
root 3351 2090 0 12:39 pts/0 00:00:00 grep --color=auto mysql
更多推荐
已为社区贡献1条内容
所有评论(0)