Home  >  Article  >  Operation and Maintenance  >  What permissions are used to start linux mysql?

What permissions are used to start linux mysql?

藏色散人
藏色散人Original
2023-03-14 09:41:211346browse

linux mysql is started with root permissions. The method to enable mysql access permissions in Linux is: 1. Check whether the listening port exists through the "netstat -ntlp | grep mysql" command; 2. Check the Mysql configuration; 3. Enter Just execute the command "mysql -u root -p use mysql;" on the database.

What permissions are used to start linux mysql?

The operating environment of this tutorial: linux5.9.8 system, MySQL5.7, Dell G3 computer.

What permissions are used to start linux mysql?

Enable remote access permissions for Mysql in Linux environment

Remotely connect to Mysql installed on Linux through Window's database visualization tool

You can follow the following steps to confirm one by one!

Check whether the listening port exists

netstat -ntlp  |grep  mysql 

Check the Mysql configuration

Execute first: vim /etc/my.cnf

[mysqld]
port = 3306
bind-address = 0.0.0.0     # 这一行改成0.0.0.0 或者直接注释掉
socket = /tmp/mysql.sock
datadir = /usr/local/mysql/var
skip-external-locking

Enter the database and execute the following commands in sequence

  • mysql -u root -p use mysql;

  • ##GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456'; #The 123456 here is the password you set for the new privileged user, % represents all hosts, or it can be specific to your host IP address

  • flush privileges; #Re Load permission data

  • select * from user; #Query whether the setting is successful

Related recommendations: "

Linux Video Tutorial

The above is the detailed content of What permissions are used to start linux mysql?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn