Mysql數(shù)據(jù)庫(kù)密碼修改 (linux下的xampp環(huán)境)
修改數(shù)據(jù)庫(kù)root密碼(必須)
在linux操作系統(tǒng)中,,xamp默認(rèn)安裝的時(shí)候,,數(shù)據(jù)庫(kù)的root賬號(hào)密碼默認(rèn)為空,,必須設(shè)置后,才能安裝系統(tǒng),;
A:進(jìn)入mysql:輸入如下命令
# /opt/lampp/bin/mysql -uroot -p
Enter password:
B:上面直接按Enter(因?yàn)槊艽a默認(rèn)為空)就可以進(jìn)入數(shù)據(jù)庫(kù)
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:設(shè)置root用戶密碼:輸入如下命令(手工)
set password for root@localhost = password('123');
備注:
在B步驟,如果沒(méi)有啟動(dòng)lampp ,會(huì)報(bào)一下錯(cuò)誤
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/opt/lampp/var/mysql/mysql.sock' (2 "No such file or directory")