Home  >  Article  >  Database  >  How to install MySQL via SSH on CentOS VPS

How to install MySQL via SSH on CentOS VPS

王林
王林forward
2023-05-28 13:24:551182browse

Inputyum install mysql-server

在CentOS VPS上怎么通过SSH安装MySQL

Press y to continue

在CentOS VPS上怎么通过SSH安装MySQL

Installation completed , set to start mysql at boot, enter chkconfig --levels 235 mysqld on

在CentOS VPS上怎么通过SSH安装MySQL

and then start tomcat, enter service mysqld start

After startup, log in to mysql and set the password

在CentOS VPS上怎么通过SSH安装MySQL

Enter set password for 'root'@'localhost' = password('12345678') ;To set the password

在CentOS VPS上怎么通过SSH安装MySQL

At this point, mysql is installed! Then create the database, first use show databases; to view the database

在CentOS VPS上怎么通过SSH安装MySQL

and then use

create database database name; to create the database,

Use

grant all privileges on database name.* to root@localhost identified by 'password'; Assign a user to the newly created database

The super user is assigned here root, the red area in the figure below is the database name.

在CentOS VPS上怎么通过SSH安装MySQL

The above is the detailed content of How to install MySQL via SSH on CentOS VPS. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete