Mysql數據庫密碼修改 (linux下的xampp環(huán)境)
修改數據庫root密碼(必須)
在linux操作系統(tǒng)中,,xamp默認安裝的時候,,數據庫的root賬號密碼默認為空,,必須設置后,才能安裝系統(tǒng),;
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")