Ubuntu mysql5.6 binary installation, ubuntumysql5.6

Source: Internet
Author: User

Ubuntu mysql5.6 binary installation, ubuntumysql5.6
Introduction

I used to use centos. Today I need to install mysql on an ubantu system. Although it is also unix-like, it is still a little different from the redhat or centos commands.

 

Download and decompress
wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.33-linux-glibc2.5-x86_64.tar.gzmv mysql-5.6.33-linux-glibc2.5-x86_64  /usr/local/mysql
Create directories and users

1. Create a mysql directory

Mkdir-p/mysql/data --- data DIRECTORY mkdir-p/mysql/log --- log directory

2. Create a user

groupadd mysqluseradd -r -g mysql mysql
Create my. cnf

The main purpose of creating the my. cnf file is to use some of its configurations during initialization.

vim /etc/my.cnf

Note: If the my. cnf file still exists in other directories in the system, delete it. You can use find to find it.

Install

1. Install the plug-in

apt-get install libaio1

2. Initialization

scripts/mysql_install_db --user=mysql --defaults-file=/etc/my.cnf --basedir=/usr/local/mysql --datadir=/mysql/data  --innodb_undo_tablespaces=3 --explicit_defaults_for_timestampchown -R mysql:mysql /mysql/ usr/local/mysql

3. Configure mysql to start the service

cp support-files/mysql.server /etc/init.d/mysqlchmod +x /etc/init.d/mysql 

4. Configure Environment Variables

vim /etc/profileexport PATH=/usr/local/mysql/bin:$PATHsource /etc/profile

Note: If you are currently installing a sudo user, you need to add sudo to some of your previous operations, but you do not need to add sudo to source.

5. Start the service

service mysql start

Note: If the current user does not have the permission, add sudo to start

6. log on to mysql

mysql -uroot
Summary

Ubuntu uses the apt-get command instead of the yum command, and does not have the chkconfig startup command.

 

 

 

Note:

Author: pursuer. chen

Blog: http://www.cnblogs.com/chenmh

All essays on this site are original. You are welcome to repost them. However, you must indicate the source of the article and clearly give the link at the beginning of the article.

Welcome to discussion

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.