Mysql数据库密码修改 (linux下的xampp环境)
修改数据库root密码(必须)
在linux操作系统中,xamp默认安装的时候,数据库的root账号密码默认为空,必须设置后,才能安装系统;
A:进入mysql:输入如下命令
# /opt/lampp/bin/mysql -uroot -p
Enter password:
B:上面直接按Enter(因为密码默认为空)就可以进入数据库
Welcome to the MariaDB monitor. Commands end with ; or \g.Your MariaDB connection id is 5Server version: 10.1.21-MariaDB Source distribution
Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.MariaDB [(none)]>
C:设置root用户密码:输入如下命令(手工)
set password for root@localhost = password('123');
备注:
在B步骤,如果没有启动lampp ,会报一下错误
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/opt/lampp/var/mysql/mysql.sock' (2 "No such file or directory")