安装完成后进行安全设置
/opt/lampp/lampp security
MySQL/phpMyAdmin用户名pma 密码YunWen0305
MySQL用户名root 密码YunWen0305
FTP用户名daemon 默认密码xampp 修改密码为YunWen0305
远程计算机访问phpMyAdmin
修改文件/opt/lampp/etc/extra/httpd-xampp.conf
将Require local改为Require all granted
MySQL数据库登录问题提示
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)安装相应的软件包出现问题
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)再次运行
sudo apt install mysql-client-core-5.7
sudo apt install mariadb-client-core-10.0
这个时候如果直接登录数据库的话会报错:
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
连接上了,问题解决
如何配置mysql远程连接
云主机本地能够连接 mysql,为何远程连接不上 mysql呢?这是因为默认安装的 mysql,出于安全考虑,只能本地连接。如果您需要远程连接,这里就需要设置一下 mysql 的权限表。具体设置的步骤如下:
进入服务器命令行:
mysql -uroot -p 密码
mysql>grant all on . to root@"%" identified by "密码";
mysql>flush privileges;
更改MySQL默认的root账户的账户名
mysql -uroot -p 密码
mysql>update user set user='xxx' where user='root';
mysql>flush privileges;
修改XAMPP网站根目录
/opt/lampp/etc/httpd.conf
卸载XAMPP
rm -rf /opt/lampp
wordpress更新插件,提示要输入网站FTP账户和密码,提示"未能连接到FTP服务器www.xxxxxx.com:21 要执行请求的操作,WordPress需要访问您网页"的解决方案
修改wp-config.php文件
define("FS_METHOD", "direct");
define("FS_CHMOD_DIR", 0777);
define("FS_CHMOD_FILE", 0777);
在wp-config.php文件最后添加上面三行。