Skip to content

Instantly share code, notes, and snippets.

@YongmingZhao
Created May 9, 2022 19:49
Show Gist options
  • Save YongmingZhao/449ff5bccdbe164f63bb106c2dbd5d0b to your computer and use it in GitHub Desktop.
Save YongmingZhao/449ff5bccdbe164f63bb106c2dbd5d0b to your computer and use it in GitHub Desktop.
Cent OS Mysql

rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
yum install mysql-server

  1. log-in your mysql via terminal as "root" --> mysql -uroot -p
  2. CREATE USER 'toor123'@'%' IDENTIFIED BY 'your-password';
  3. GRANT ALL PRIVILEGES ON . TO 'toor123'@'%';flush privileges;
  4. Open mysql's configuration file: vi /etc/my.cnf
  5. Append the following directive into the [mysqld] section: bind-address=192.168.1.80 (server's address)
  6. Make sure line "skip-networking" is commented
  7. Store your changes and restart Mysqld: systemctl start|stop|status mysqld
  8. firewall-cmd --zone=public --add-port=3306/tcp --permanent
    firewall-cmd --reload
    firewall-cmd --zone=public --query-port=3306/tcp
    firewall-cmd --zone=public --remove-port=3306/tcp --permanent
  9. You need the FILE privilege in order to be allowed to use SELECT...INTO OUTFILE, which seems to be what mysqldump --tab uses to generate the tab-separated dump.
    This privilege is global, which means it may only be granted "ON ." : GRANT FILE ON *.* TO 'backup'@'%';
  10. show global variables like '%secure%';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment