安裝完成后進(jìn)行安全設(shè)置
/opt/lampp/lampp security
MySQL/phpMyAdmin用戶名pma 密碼YunWen0305
MySQL用戶名root 密碼YunWen0305
FTP用戶名daemon 默認(rèn)密碼xampp 修改密碼為YunWen0305
遠(yuǎn)程計(jì)算機(jī)訪問(wèn)phpMyAdmin
修改文件/opt/lampp/etc/extra/httpd-xampp.conf
將Require local改為Require all granted
MySQL數(shù)據(jù)庫(kù)登錄問(wèn)題提示
mysql -uroot -p
The program 'mysql' can be found in the following packages:
- mysql-client-core-5.7
- mariadb-client-core-10.0
Try: apt install <selected package>
(1)安裝相應(yīng)的軟件包出現(xiàn)問(wèn)題
sudo apt install mysql-client-core-5.7
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package mysql-client-core-5.7
E: Couldn't find any package by glob 'mysql-client-core-5.7'
E: Couldn't find any package by regex 'mysql-client-core-5.7'
(2)更換軟件源
sudo apt-get update
(3)再次運(yùn)行
sudo apt install mysql-client-core-5.7
sudo apt install mariadb-client-core-10.0
這個(gè)時(shí)候如果直接登錄數(shù)據(jù)庫(kù)的話會(huì)報(bào)錯(cuò):
Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")
解決方法:
sudo mkdir /var/run/mysqld
sudo ln -s /opt/lampp/var/mysql/mysql.sock /var/run/mysqld/mysqld.sock
再次連接:
mysql -u root -p
連接上了,問(wèn)題解決
如何配置mysql遠(yuǎn)程連接
云主機(jī)本地能夠連接 mysql,為何遠(yuǎn)程連接不上 mysql呢?這是因?yàn)槟J(rèn)安裝的 mysql,出于安全考慮粱甫,只能本地連接。如果您需要遠(yuǎn)程連接,這里就需要設(shè)置一下 mysql 的權(quán)限表淫茵。具體設(shè)置的步驟如下:
進(jìn)入服務(wù)器命令行:
mysql -uroot -p 密碼
mysql>grant all on . to root@"%" identified by "密碼";
mysql>flush privileges;
更改MySQL默認(rèn)的root賬戶的賬戶名
mysql -uroot -p 密碼
mysql>update user set user='xxx' where user='root';
mysql>flush privileges;
修改XAMPP網(wǎng)站根目錄
/opt/lampp/etc/httpd.conf
卸載XAMPP
rm -rf /opt/lampp
wordpress更新插件,提示要輸入網(wǎng)站FTP賬戶和密碼蹬跃,提示"未能連接到FTP服務(wù)器www.xxxxxx.com:21 要執(zhí)行請(qǐng)求的操作,WordPress需要訪問(wèn)您網(wǎng)頁(yè)"的解決方案
修改wp-config.php文件
define("FS_METHOD", "direct");
define("FS_CHMOD_DIR", 0777);
define("FS_CHMOD_FILE", 0777);
在wp-config.php文件最后添加上面三行匙瘪。