


How to install mysql8 and configure remote connection with docker under Linux
Step 1: Download the mysql mirror
docker pull mysql
The default is to download the latest stable version
Step 2: Start the mysql mirror
docker run --name dockermysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=mysqlpassword -d mysql
--name is the alias of the image
-p maps 3306 to 3306 (docker is a virtual machine with its own port)
-e MYSQL_ROOT_PASSWORD=mysqlpassword Set the mysql server password (required later, be sure to remember)
-d Backend startup
Start the mirror name (can Replace with id)
The third step: Query the started image
docker ps
is as follows:
The fourth step Step: Enter the container
docker exec -it dockermysql bash
dockermysql is the name of the image, you can use id instead
Step 5: Log in to mysql
mysql -u root -p
and enter the password set above
Step 6: Set up remote access
Switch database (the default should be this, it’s okay not to switch, just switch it to be on the safe side)
use mysql;
Change remote link authorization
grant all privileges on *.* to 'root'@'%';
Step 7: Navicat Link Times 2059 Error
The reason for the error is a problem with the encryption method
Check it:
select Host,User,plugin from user;
The result before modification is as follows:
Execute the modification command:
alter user 'root'@'%' identified with mysql_native_password by 'yourPassword';
Change it to your mysql password
The result after successful modification is as follows:
The above is the detailed content of How to install mysql8 and configure remote connection with docker under Linux. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Solution to permission issues when viewing Python version in Linux terminal When you try to view Python version in Linux terminal, enter python...

Causes and solutions for errors when using PECL to install extensions in Docker environment When using Docker environment, we often encounter some headaches...

The page is blank after PHP connects to MySQL, and the reason why die() function fails. When learning the connection between PHP and MySQL database, you often encounter some confusing things...

PHP...

Many website developers face the problem of integrating Node.js or Python services under the LAMP architecture: the existing LAMP (Linux Apache MySQL PHP) architecture website needs...

Using python in Linux terminal...

Regarding the problem of removing the Python interpreter that comes with Linux systems, many Linux distributions will preinstall the Python interpreter when installed, and it does not use the package manager...

Configure the apscheduler timing task as a service on macOS platform, if you want to configure the apscheduler timing task as a service, similar to ngin...
