标签:本地 刷新 grants 虚拟机 挂载 eve port pass yum
MariaDB主机 | 192.168.142.128/24 |
nfs | 192.168.142.140/24 |
httpd1 | 192.168.142.135/24 |
httpd2 | 192.168.142.141/24 |
GRANT SELECT,UPDATE,ALTER,INSERT,CREATE,DELETE ON wpress.* TO ‘wpuser‘@‘192.168.142.%‘ IDENTIFIED BY ‘password‘;
在httpd端进行登陆测试 -->
mysql -uwpress -h192.168.142.128 -ppassword
>SHOW GRANTS; --> 登陆进mysql服务器后,使用此命令显示授权信息;
MariaDB [(none)]> show grants;
+-------------------------------------------------------------------------------------------------------------------+
| Grants for wpuser@192.168.142.% |
+-------------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO ‘wpuser‘@‘192.168.142.%‘ IDENTIFIED BY PASSWORD ‘*6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9‘ |
| GRANT SELECT, INSERT, UPDATE, CREATE, DELETE, ALTER ON `wpress`.* TO ‘wpuser‘@‘192.168.142.%‘ |
+-------------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)
vim /var/www/html/index.php --> ↓修改如下↓
<?php echo ‘<title> This is a PHP page </title>‘; $link=mysql_connect(‘192.168.142.128‘,‘wpuser‘,‘password‘); if ($link) echo "Mysql Connected"; --> 连接成功 else echo "Mysql Failed"; mysql_close(); phpinfo(); ?>
[root@nfs ~]# showmount -e localhost Export list for localhost: /share/wp 192.168.142.0/24
删除wordpress/, 删除数据库新建
相关命令整理:
nfs服务器: nfsd(nfs-utils), mountd, idmapd
showmount -e HOST_IP
showmount -a HOST_IP 显示指定NFS上所有的挂载
挂载
mount -t nfs SERVER:/path/to/shared_fs /path/to/mount_point
/etc/exports: 格式:
directory (or file system) client1(option1, option2) client2(option1, option2)
LAMP 建立 Wordpress 站点 Linux Apache MariaDB PHP
标签:本地 刷新 grants 虚拟机 挂载 eve port pass yum
原文地址:https://www.cnblogs.com/gettolive/p/9167162.html