Divi WordPress Theme
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress Reply To: Error connecting remote DB

Discussion in 'Misc WordPress Requests' started by Cesare Rossi, Dec 4, 2017.

  1. Cesare Rossi

    Guest

    Reply To: Error connecting remote DB, by Cesare Rossi

    Steve,

    thank You for your answer.

    In both the servers the hosts file contains the definition for both server names:

    10.15.63.82 centos6 centos6.ross.lan
    10.15.63.83 centosdb centosdb.ross.lan

    I’ve tried to assign permissions to the DB on: hostname (short), hostname (FQDN), IP address for root & wordpressuser

    ____________________________________________________

    #!/bin/bash

    dbadmin=root
    dbadminpassword=VMware1!
    dbaddress=centosdb.ross.lan
    wpdbname=wordpress
    wpuser=wordpressuser
    wppassword=VMware1!
    wpaddress=centos6.ross.lan
    wpaddressshort=centos6
    wpaddressip=10.15.63.82

    /sbin/chkconfig iptables off
    /sbin/chkconfig ip6tables off
    /sbin/service iptables stop
    /sbin/service ip6tables stop

    /usr/bin/yum install mysql mysql-server -y
    /sbin/chkconfig mysqld on
    /sbin/service mysqld start

    /usr/bin/mysql -e “UPDATE mysql.user SET Password=PASSWORD(‘$dbadminpassword’) WHERE User=’$dbadmin’;”
    /usr/bin/mysql -e “DELETE FROM mysql.user WHERE User=”;”
    /usr/bin/mysql -e “DROP DATABASE test;”
    /usr/bin/mysql -e “FLUSH PRIVILEGES;”

    /usr/bin/mysql -e “CREATE DATABASE $wpdbname;” –user=$dbadmin –password=$dbadminpassword

    /usr/bin/mysql -e “CREATE USER ‘$dbadmin’@’$wpaddress’;” –user=$dbadmin –password=$dbadminpassword
    /usr/bin/mysql -e “SET PASSWORD FOR ‘$dbadmin’@’$wpaddress’=PASSWORD(‘$dbadminpassword’);” –user=$dbadmin –password=$dbadminpassword
    /usr/bin/mysql -e “GRANT ALL PRIVILEGES ON *.* TO ‘$dbadmin’@’$wpaddress’ IDENTIFIED BY ‘$dbadminpassword’;” –user=$dbadmin –password=$dbadminpassword
    /usr/bin/mysql -e “GRANT ALL ON *.* TO ‘$dbadmin’@’$wpaddress’ IDENTIFIED BY ‘$dbadminpassword’;” –user=$dbadmin –password=$dbadminpassword

    /usr/bin/mysql -e “CREATE USER ‘$dbadmin’@’$wpaddressshort’;” –user=$dbadmin –password=$dbadminpassword
    /usr/bin/mysql -e “SET PASSWORD FOR ‘$dbadmin’@’$wpaddressshort’=PASSWORD(‘$dbadminpassword’);” –user=$dbadmin –password=$dbadminpassword
    /usr/bin/mysql -e “GRANT ALL PRIVILEGES ON *.* TO ‘$dbadmin’@’$wpaddressshort’ IDENTIFIED BY ‘$dbadminpassword’;” –user=$dbadmin –password=$dbadminpassword
    /usr/bin/mysql -e “GRANT ALL ON *.* TO ‘$dbadmin’@’$wpaddressshort’ IDENTIFIED BY ‘$dbadminpassword’;” –user=$dbadmin –password=$dbadminpassword

    /usr/bin/mysql -e “CREATE USER ‘$dbadmin’@’$wpaddressip’;” –user=$dbadmin –password=$dbadminpassword
    /usr/bin/mysql -e “SET PASSWORD FOR ‘$dbadmin’@’$wpaddressip’=PASSWORD(‘$dbadminpassword’);” –user=$dbadmin –password=$dbadminpassword
    /usr/bin/mysql -e “GRANT ALL PRIVILEGES ON *.* TO ‘$dbadmin’@’$wpaddressip’ IDENTIFIED BY ‘$dbadminpassword’;” –user=$dbadmin –password=$dbadminpassword
    /usr/bin/mysql -e “GRANT ALL ON *.* TO ‘$dbadmin’@’$wpaddressip’ IDENTIFIED BY ‘$dbadminpassword’;” –user=$dbadmin –password=$dbadminpassword

    /usr/bin/mysql -e “CREATE USER ‘$wpuser’@’$wpaddress’;” –user=$dbadmin –password=$dbadminpassword
    /usr/bin/mysql -e “SET PASSWORD FOR ‘$wpuser’@’$wpaddress’=PASSWORD(‘$wppassword’);” –user=$dbadmin –password=$dbadminpassword
    /usr/bin/mysql -e “GRANT ALL PRIVILEGES ON $wpdbname.* TO ‘$wpuser’@’$wpaddress’ IDENTIFIED BY ‘$wppassword’;” –user=$dbadmin –password=$dbadminpassword
    /usr/bin/mysql -e “GRANT ALL ON $wpdbname.* TO ‘$wpuser’@’$wpaddress’ IDENTIFIED BY ‘$wppassword’;” –user=$dbadmin –password=$dbadminpassword

    /usr/bin/mysql -e “CREATE USER ‘$wpuser’@’$wpaddressshort’;” –user=$dbadmin –password=$dbadminpassword
    /usr/bin/mysql -e “SET PASSWORD FOR ‘$wpuser’@’$wpaddressshort’=PASSWORD(‘$wppassword’);” –user=$dbadmin –password=$dbadminpassword
    /usr/bin/mysql -e “GRANT ALL PRIVILEGES ON $wpdbname.* TO ‘$wpuser’@’$wpaddressshort’ IDENTIFIED BY ‘$wppassword’;” –user=$dbadmin –password=$dbadminpassword
    /usr/bin/mysql -e “GRANT ALL ON $wpdbname.* TO ‘$wpuser’@’$wpaddressshort’ IDENTIFIED BY ‘$wppassword’;” –user=$dbadmin –password=$dbadminpassword

    /usr/bin/mysql -e “CREATE USER ‘$wpuser’@’$wpaddresssip’;” –user=$dbadmin –password=$dbadminpassword
    /usr/bin/mysql -e “SET PASSWORD FOR ‘$wpuser’@’$wpaddresip’=PASSWORD(‘$wppassword’);” –user=$dbadmin –password=$dbadminpassword
    /usr/bin/mysql -e “GRANT ALL PRIVILEGES ON $wpdbname.* TO ‘$wpuser’@’$wpaddressip’ IDENTIFIED BY ‘$wppassword’;” –user=$dbadmin –password=$dbadminpassword
    /usr/bin/mysql -e “GRANT ALL ON $wpdbname.* TO ‘$wpuser’@’$wpaddressip’ IDENTIFIED BY ‘$wppassword’;” –user=$dbadmin –password=$dbadminpassword

    /usr/bin/mysql -e “FLUSH PRIVILEGES;” –user=$dbadmin –password=$dbadminpassword
    ______________________________________________________________________________

    No way…

    Reply To: Error connecting remote DB
     
    #1

Share This Page

Monarch Social Sharing Plugin