MySQL 5.6.28 installation and configuration tutorial under Linux (Ubuntu)

MySQL 5.6.28 installation and configuration tutorial under Linux (Ubuntu)

mysql5.6.28 installation and configuration method

1. Check the basic system information and try to install it with yum

$ sudo -s
# df -lh
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 79G 1.6G 74G 3% /
udev 3.9G 8.0K 3.9G 1% /dev
tmpfs 799M 252K 799M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 3.9G 0 3.9G 0% /run/shm
# uname -a
Linux nj01 3.16.0-34-generic #47~14.04.1-Ubuntu SMP Fri Apr 10 17:49:16 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

# rpm -qa|grep yum
The program 'rpm' is not currently installed. You can install it by typing:
apt-get install rpm
# apt-get install rpm
…
# rpm -qa|grep yum
# yum install 
The program 'yum' is currently not installed. You can install it by typing:
apt-get install yum
# apt-get install yum
…
# yum install mysql
Setting up Installation Process
No package mysql available.
Nothing to do

2. Change the installation method

# apt-get install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
libdbd-mysql-perl libdbi-perl libhtml-template-perl libmysqlclient18 libnet-daemon-perl libplrpc-perl libterm-readkey-perl mysql-client-5.5
mysql-client-core-5.5 mysql-common mysql-server-5.5 mysql-server-core-5.5
Suggested packages:
libipc-sharedcache-perl tinyca mailx
The following NEW packages will be installed:
libdbd-mysql-perl libdbi-perl libhtml-template-perl libmysqlclient18 libnet-daemon-perl libplrpc-perl libterm-readkey-perl mysql-client-5.5
mysql-client-core-5.5 mysql-common mysql-server mysql-server-5.5 mysql-server-core-5.5
0 upgraded, 13 newly installed, 0 to remove and 15 not upgraded.
Need to get 27.6 MB of archives.
After this operation, 98.2 MB of additional disk space will be used.
Do you want to continue [Y/n]?
Get:1 http://apt.wmcloud.com/ubuntu/ precise-updates/main mysql-common all 5.5.52-0ubuntu0.12.04.1 [12.6 kB]
Get:2 http://apt.wmcloud.com/ubuntu/ precise-updates/main libmysqlclient18 amd64 5.5.52-0ubuntu0.12.04.1 [952 kB]
Get:3 http://apt.wmcloud.com/ubuntu/ precise/main libnet-daemon-perl all 0.48-1 [43.1 kB]
Get:4 http://apt.wmcloud.com/ubuntu/ precise/main libplrpc-perl all 0.2020-2 [36.0 kB]
Get:5 http://apt.wmcloud.com/ubuntu/ precise/main libdbi-perl amd64 1.616-1build2 [849 kB]
Get:6 http://apt.wmcloud.com/ubuntu/ precise/main libdbd-mysql-perl amd64 4.020-1build2 [106 kB]
Get:7 http://apt.wmcloud.com/ubuntu/ precise-updates/main mysql-client-core-5.5 amd64 5.5.52-0ubuntu0.12.04.1 [1,948 kB]
Get:8 http://apt.wmcloud.com/ubuntu/ precise/main libterm-readkey-perl amd64 2.30-4build3 [28.6 kB]
Get:9 http://apt.wmcloud.com/ubuntu/ precise-updates/main mysql-client-5.5 amd64 5.5.52-0ubuntu0.12.04.1 [8,365 kB]
Get:10 http://apt.wmcloud.com/ubuntu/ precise-updates/main mysql-server-core-5.5 amd64 5.5.52-0ubuntu0.12.04.1 [6,327 kB]
Get:11 http://apt.wmcloud.com/ubuntu/ precise-updates/main mysql-server-5.5 amd64 5.5.52-0ubuntu0.12.04.1 [8,855 kB]
Get:12 http://apt.wmcloud.com/ubuntu/ precise/main libhtml-template-perl all 2.10-1 [65.0 kB]
Get:13 http://apt.wmcloud.com/ubuntu/ precise-updates/main mysql-server all 5.5.52-0ubuntu0.12.04.1 [10.8 kB]
Fetched 27.6 MB in 0s (38.2 MB/s)
Preconfiguring packages ...
Selecting previously unselected package mysql-common.
(Reading database ... 77501 files and directories currently installed.)
Unpacking mysql-common (from .../mysql-common_5.5.52-0ubuntu0.12.04.1_all.deb) ...
Selecting previously unselected package libmysqlclient18.
Unpacking libmysqlclient18 (from .../libmysqlclient18_5.5.52-0ubuntu0.12.04.1_amd64.deb) ...
Selecting previously unselected package libnet-daemon-perl.
Unpacking libnet-daemon-perl (from .../libnet-daemon-perl_0.48-1_all.deb) ...
Selecting previously unselected package libplrpc-perl.
Unpacking libplrpc-perl (from .../libplrpc-perl_0.2020-2_all.deb) ...
Selecting previously unselected package libdbi-perl.
Unpacking libdbi-perl (from .../libdbi-perl_1.616-1build2_amd64.deb) ...
Selecting previously unselected package libdbd-mysql-perl.
Unpacking libdbd-mysql-perl (from .../libdbd-mysql-perl_4.020-1build2_amd64.deb) ...
Selecting previously unselected package mysql-client-core-5.5.
Unpacking mysql-client-core-5.5 (from .../mysql-client-core-5.5_5.5.52-0ubuntu0.12.04.1_amd64.deb) ...
Selecting previously unselected package libterm-readkey-perl.
Unpacking libterm-readkey-perl (from .../libterm-readkey-perl_2.30-4build3_amd64.deb) ...
Selecting previously unselected package mysql-client-5.5.
Unpacking mysql-client-5.5 (from .../mysql-client-5.5_5.5.52-0ubuntu0.12.04.1_amd64.deb) ...
Selecting previously unselected package mysql-server-core-5.5.
Unpacking mysql-server-core-5.5 (from .../mysql-server-core-5.5_5.5.52-0ubuntu0.12.04.1_amd64.deb) ...
Processing triggers for man-db ...
Setting up mysql-common (5.5.52-0ubuntu0.12.04.1) ...
Selecting previously unselected package mysql-server-5.5.
(Reading database ... 77879 files and directories currently installed.)
Unpacking mysql-server-5.5 (from .../mysql-server-5.5_5.5.52-0ubuntu0.12.04.1_amd64.deb) ...
Selecting previously unselected package libhtml-template-perl.
Unpacking libhtml-template-perl (from .../libhtml-template-perl_2.10-1_all.deb) ...
Selecting previously unselected package mysql-server.
Unpacking mysql-server (from .../mysql-server_5.5.52-0ubuntu0.12.04.1_all.deb) ...
Processing triggers for ureadahead ...
Processing triggers for man-db ...
Setting up libmysqlclient18 (5.5.52-0ubuntu0.12.04.1) ...
Setting up libnet-daemon-perl (0.48-1) ...
Setting up libplrpc-perl (0.2020-2) ...
Setting up libdbi-perl (1.616-1build2) ...
Setting up libdbd-mysql-perl (4.020-1build2) ...
Setting up mysql-client-core-5.5 (5.5.52-0ubuntu0.12.04.1) ...
Setting up libterm-readkey-perl (2.30-4build3) ...
Setting up mysql-client-5.5 (5.5.52-0ubuntu0.12.04.1) ...
Setting up mysql-server-core-5.5 (5.5.52-0ubuntu0.12.04.1) ...
Setting up mysql-server-5.5 (5.5.52-0ubuntu0.12.04.1) ...
160928 10:56:48 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
160928 10:56:48 [Note] /usr/sbin/mysqld (mysqld 5.5.52-0ubuntu0.12.04.1) started as process 6166 ...
mysql start/running, process 6304
Setting up libhtml-template-perl (2.10-1) ...
Setting up mysql-server (5.5.52-0ubuntu0.12.04.1) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place

Just enter the root password during the installation process;

3. Installation successful, basic configuration

mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' identified by '******';
Query OK, 0 rows affected (0.00 sec)

mysql> 
mysql> 
mysql> 
mysql> 
mysql> 
mysql> create database testdb;
Query OK, 1 row affected (0.01 sec)

mysql> 
mysql> 
mysql> 
mysql> 
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
|mysql |
|testdb|
| performance_schema |
+--------------------+
4 rows in set (0.00 sec)

mysql> insert into mysql.user(Host,User,Password) values("%","test",password("******"));
Query OK, 1 row affected, 3 warnings (0.00 sec)

mysql> 
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> GRANT ALL PRIVILEGES ON testdb.* TO 'test'@'% identified by '******';
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

4. Problem Solving

(1) Access error, network connection error: 10038, telnet is unavailable
S1. Turn off the firewall # ufw allow 3306, still doesn't work
S2. User network permissions have been granted (rant all privileges on . to 'root'@'%' identified by 'youpassword' with grant option;)
S3. Check network information # netstat -ano
tcp 0 0 127.0.0.1:3306
It should be a problem with binding IP, modify /etc/MySQL/my.conf
Find the line bind-address = 127.0.0.1 and change it to bind-address = 0.0.0.0. The problem is solved.
(2) The table is case-sensitive:
After logging in with the root account, add lower_case_table_names=1 after [mysqld] in /etc/my.cnf and restart the MYSQL service. The setting is now successful: table names are not case sensitive;
Detailed explanation of the lower_case_table_names parameter:
lower_case_table_names = 0
0: case sensitive, 1: case insensitive

5. Basic service commands

# Start MySQL$ sudo service mysql start 
# Shut down MySQL$ sudo service mysql stop
# Restart MySQL$ sudo service mysql restart
# Other commands: $ sudo /etc/init.d/mysql start
$ sudo /etc/init.d/mysql stop
$ sudo /etc/init.d/mysql restart

6. Uninstall Mysql:

sudo apt-get autoremove mysql* --purge
sudo apt-get remove apparmor
sudo apt-get install mysql-server mysql-common

After uninstalling, delete mysql related files (/var/lib/mysql, /etc/mysql, etc., you can use find -name mysql to query the relevant path)

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • How to install MySQL on Ubuntu 18.04 (linux)
  • MySQL 8.0 installation tutorial under Linux
  • Detailed tutorial on the free installation version of MySQL 5.7.18 on Linux
  • Diagram of the process from uninstallation to installation of MySQL 5.7.18 yum under Linux
  • Detailed tutorial on installing MySQL 5.7.17 on Oracle Linux 6.8
  • Detailed tutorial on how to install MySQL 5.7.18 in Linux (CentOS 7) using YUM
  • Install MySQL 5.7 on Ubuntu 18.04
  • Detailed tutorial on how to install mysql8.0 using Linux yum command
  • MySQL 8.0.15 installation and configuration graphic tutorial and password change under Linux
  • Complete steps to install MySQL 8.0.x on Linux

<<:  Vue implements simple calculator function

>>:  Docker learning method steps to build ActiveMQ message service

Recommend

CSS Skills Collection - Classics among Classics

Remove the dotted box on the link Copy code The co...

Detailed explanation of Docker common commands Study03

Table of contents 1. Help Command 2. Mirror comma...

How to use Tencent slider verification code in Vue3+Vue-cli4 project

Introduction: Compared with traditional image ver...

In-depth explanation of modes and environment variables in Vue CLI

Preface In the development of actual projects, we...

Docker uses root to enter the container

First run the docker container Run the command as...

Build a Docker image using Dockerfile

Table of contents Build a Docker image using Dock...

Vue3+TypeScript encapsulates axios and implements request calls

No way, no way, it turns out that there are peopl...

How to query the minimum available id value in the Mysql table

Today, when I was looking at the laboratory proje...

mysql 8.0.12 winx64 download and installation tutorial

MySQL 8.0.12 download and installation tutorial f...

How to build a new image based on an existing image in Docker

Building new images from existing images is done ...

Linux service monitoring and operation and maintenance

Table of contents 1. Install the psutil package S...

Vue Element-ui form validation rule implementation

Table of contents 1. Introduction 2. Entry mode o...