Install MySQL database on Linux

Disclaimer: The materials used in this column are written by VIP students of Kaige Academy. Students have the right to remain anonymous and have the right to final interpretation of the article. Kaige Academy aims to promote VIP students to learn from each other based on public notes.

Install MySQL database on Linux:

Unzip package installation (there is no data directory installation method) The following is the download address of the unzip package

https://dev.mysql.com/downloads/mysql/

1. Download the MySQL decompression package
2. Compress the MySQL installation package
3. Modify the my-default.ini file
basedir = "C:\Program Files\mysql-5.7.16-winx64"
datadir = "C:\ProgramData\mysql\data"
Remember to store the database data file address in another directory
4. Change my-default.ini to my.ini

image

5. Start dos as an administrator and enter the bin directory
cd C:\Program Files\mysql-5.7.16-winx64\bin\
6. Execute MySQL --initialize-insecure in dos

image

7. Execute the mysqld program to see if there is a mysqld program in the process.
8. You must restart the mysqld program every time your current mysql database is restarted.
9. Install mysql to the server in Windows mysqld -install
mysqld --install MySQL

How to enter the database?
After installation, the user name is: root, if it is on windows, it is an
empty
password
3.show databases to view all the tables inside

image

4. If it is the following situation, the server is not open

image

5. How to change the password?
First connect to the mysql database use mysql;
then enter the modification command update user set authentication_string = password ('123456a') where user='root'
123456a is your password
exit Exit the mysql console
and restart the server after modification, your password can be used The
password login method is: mysql -uroot -p
The second database password modification: set password=password('123456');

What if the mysql password is forgotten?
The first way: you can delete your data directory and create it again
. The second way: you need to find the
decompressed version of your my.ini file. You can find the installation version directly under the mysql installation path
, you need to find it in it The data parent directory looks for
C:\ProgramData\MySQL\MySQL Server 5.7

Then add a command in my.ini: skip-grant-tables
as shown below, add this statement under mysqld, which means skip password verification

image

After writing, restart the server and you will not need a password to log in
. After startup, you need to use this mode to modify the password
use mysql;
update user set authentication_string = password ('123456a') where user='root'
and then put in my.ini Delete the skip-grant-tables and
restart the server
. What if I can't connect to mysql remotely?
Enter ipconfig in the console to check the IP address of the intranet
ping 192.168.0.105
ping and see if you can connect

Support external network connection:
first modify the parameters to support remote connection
use mysql
update user set host='%' where user='root';
mysql -h 192.168.0.105 -u root -p

Using mysql generally downloads a management tool, such as sqlyog, navigation cat, etc.
How to download this tool? can be searched online

image

Install MySQL on linux:
first go to: www.mysql.com
official website to download a linux mysql

image

Copy its link address and download it to your drive letter

image

1. Download the rpm package (source installation package)
wget
https://repo.mysql.com//mysql57-community-release-el7-11.noarch.rpm
2. Use yum to install your source package
yum localinstall mysql57-community- release-el7-11.noarch.rpm
3. Install the mysql service program
yum install mysql-community-server

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326457717&siteId=291194637