Linux system installation MySQL and related configuration

Source: Internet
Author: User
Tags safe mode iptables

  1. Installation
    1. Server installation. Use command: sudo yum-y install Mysql-server
    2. Client Installation. Use command: sudo yum-y install MySQL
  2. Set boot up
    1. Sudo/sbin/chkconfig--add mysqld
    2. Sudo/sbin/chkconfig mysqld on
    3. Sudo/sbin/service mysqld Start
  3. Set Root password
    1. sudo mysqladmin-u root password ' test123 '
  4. Connect to MySQL
    1. Mysql-u root-p test123
  5. Modify root Remote access permissions
    1. Close mysqld Service: Sudo/sbin/service mysqld stop
    2. Safe Mode login: sudo mysqld_safe--user=mysql--skip-grant-tables--skip-networking &
    3. Execute current permission Query command: show grants; (This step is optional)
    4. Add Permission: Grant all privileges on *. * to ' root ' @ ' * ' identified by ' 123456 ' with Grant option;
    5. Refresh Permissions table: Flush privileges;
    6. Exit Mysql:quit
    7. Restart MySQL service: Sudo/sbin/service mysqld start
    8. Iptables Open 3306 Service:

      #/sbin/iptables-i input-p TCP--dport 3306-j ACCEPT
      #/etc/rc.d/init.d/iptables Save:

      # Service Iptables Restart restart effective

    9. Or shut down the firewall: sudo service iptables stop
    10. Connect using a remote DB tool such as Navicat
  6. Creating databases: Create Database XXX;
  7. Enter the database: use XXX;

Linux system installation MySQL and related configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.