Unzip and install MySQL in Ubuntu

Source: Internet
Author: User
Unzip MySQL in Ubuntu and install Ubuntu

1. unzip the package to/usr/local/mysql in Ubuntu.
Groupadd mysql
Useradd-g mysql
Cd/usr/local/mysql
Chown-R mysql.
Chgrp-R mysql.
Chown-R root.
Chown-R mysql data
Cp/usr/local/mysql/support-files/mysql. server/etc/init. d/mysqld
Cp/usr/local/mysql/support-files/my-huge.cnf/etc/my. cnf

2. modify my. cnf
Nano/etc/my. cnf
Add
Basedir =/usr/local/mysql
Datadir =/home/mysql

3. initialize the database
Scripts/mysql_install_db -- user = mysql

4. start
Bin/mysqld_safe -- user = mysql &
Change password
Mysql> use mysql
Mysql> UPDATE user SET password = PASSWORD ('root') WHERE user = 'root ';
Mysql> flush privileges;
Mysql> exit

5. set automatic startup
Apt-get install chkconfig
Chkconfig -- add mysqld
Chkconfig mysqld on

6. add mysql to path
Nano/etc/profile
Add this sentence before umask
Export PATH = $ PATH:/usr/local/mysql/bin

7. restart the system
Reboot

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.