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 |