• notice
  • Congratulations on the launch of the Sought Tech site

Install mysql5.6 in the Ubuntu system (through binary)

First, download and unzip first

wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.33-linux-glibc2.5-x86_64.tar.gz
mv mysql-5.6.33-linux-glibc2.5-x86_64/usr/local/mysql

Second, create directories and users

1.Create a mysql directory

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

2.Create user

groupadd mysql
useradd -r -g mysql mysql

3.Create my.cnf

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

vim/etc/my.cnf

Note: If there are still my.cnf files in other directories in the system, please delete them, you can use find to find them

Four.Installation

1.Install plugins

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_timestamp

chown -R mysql:mysql/mysql/usr/local/mysql

3.Configure mysql to start the service

cp support-files/mysql.server/etc/init.d/mysql

chmod +x/etc/init.d/mysql 

4.Configure environment variables

vim/etc/profile
export PATH=/usr/local/mysql/bin:$PATH
source/etc/profile

Note: If your current installation user is a sudo user, then some of your previous operations All need to add sudo, but source does not need to be added here

5.Start the service

service mysql start

Note: If the current user does not have permission, you need to add sudo to start here.

6.Log in to mysql

mysql -uroot

Summary

There is no yum command in ubuntu, but the apt-get command, and there is no chkconfig boot command, which will be studied later.The above is the entire content of this article.I hope that the content of this article will be helpful to your study or work.If you have any questions, you can leave a message to communicate.

Tags

Technical otaku

Sought technology together

Related Topic

1 Comments

author

purchase atorvastatin pills & lt;a href="https://lipiws.top/"& gt;atorvastatin for sale online& lt;/a& gt; buy lipitor 20mg generic

Gztfiq

2024-03-08

Leave a Reply

+