MySQL installation under Linux

Source: Internet
Author: User

1.

    • https://www.mysql.com/downloads/
    • Select Community Server

  

    • Click Dowload
    • Select version, currently selected version 5.6

    • Click to download mysql-5.6.38-linux-glibc2.12-i686.tar.gz
    • Select No thanks

2. Install MySQL

Tar-xvzf mysql-5.6.38-linux-glibc2.12-i686.tar.gz

MV Mysql-5.6.38-linux-glibc2.12-i686/mysql

    • Add system MySQL Group and MySQL User:

      Execute command: Groupadd MySQL and useradd-r-g MySQL MySQL

    • Create MySQL data directory, new directory does not exist then create

Database data default directory Datadir=/var/lib/mysql, available through VIM/ETC/MY.CNF view

  

The modified directory is MKDIR-P data, no folders created, there are no created

    • Modify Directory Permissions

Chown-r Mysql:mysql./

    • Initializing the database

./scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql--datadir=/usr/local/mysql/data

    • Modify permissions to Root

[Email protected] mysql]# chown-r root:root.

[Email protected] mysql]# chown-r mysql:mysql data

    • Add Start Service
    • [email protected] mysql]# CP Support-files/mysql.server/etc/init.d/mysql

    • [[Email protected] mysql]# service MySQL start

    • Set the root user password
    • ./bin/mysqladmin-u root password ' 123456 '
    • Problems encountered

[Email protected] bin]#./mysql
ERROR 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using Password:no)

    • Workaround
    • [Email protected] bin]#/mysqld_safe--user=mysql--skip-grant-tables--skip-networking &
    • [Email protected] bin]#./mysql-u Root MySQL

    • mysql> UPDATE user SET Password=password (' 123456 ') where user= ' root ';
    • mysql> FLUSH privileges;
    • Mysql> quit

MySQL installation under Linux

Related Article

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.