当前位置:网站首页>Install MySQL in Ubuntu and create new users
Install MySQL in Ubuntu and create new users
2022-07-25 09:29:00 【__ Samual】
install MySQL
First , Check out your Ubuntu Has it been installed? MySQL
Open the terminal , Enter the following command :
apt list | grep mysql-serverIf the installation is successful, it will be shown as follows

If not already installed , Enter the following command at the terminal :
sudo apt-get install mysql-serverCarry out orders , The system will automatically MySQL Installation .
Create a new user
When you complete the above MySQL After installation , We can log in MySQL, When logging in, we need to log in with user name and password , But when installing according to the above process , It doesn't let us set the user name and password .
All of us use regular login , Will report a mistake . Pictured

Then after this time , We can enter the following commands at the terminal , Check it out. MySQL Default user and password in
sudo cat /etc/mysql/debian.cnfThe box below is MySQL The default user name and password in ( Everyone's password is different )

then , According to the default user and password, we can login to MySQL in
mysql -udebian-sys-maint -pXXXXXXXXXX( password )

Get into MySQL In the after , We can change our user name and password
First , choice mysql
use mysql;then , Create a new user
CREATE USER ' user name '@'localhost' IDENTIFIED BY ' password ';
Create success , After that, we can check the current MySQL All users in
select user,host from mysql.user;
Once created , You can login through the user and password you create MySQL 了
however , In this way, newly created users have very few permissions , They can only perform operations that do not require permission . Such as login MySQL、 Use SHOW Statement to query the list of all storage engines and character sets .
therefore , We need to give him authority
grant all on*.*to [email protected];
This sentence , It is to give all permissions to the new user created .
When the assignment is complete , New users can complete any operation of the database .
边栏推荐
- @2-1 CCF 2020-12-01 期末预测之安全指数
- Mongodb installation and use
- < T> Generic method demonstration
- Publish Yum private server using nexus3 (offline intranet)
- Go基础2
- Go foundation 1
- MySQL takes the query result as the data updated by update, and concatenates it after the original field data (Lej)
- 卷积神经网络的兴趣简单介绍
- [selected] from simple to deep, you will understand MQ principles and application scenarios
- Understand why we should rewrite the equals method and hashcode method at the same time + example analysis
猜你喜欢

@5-1 CCF 2019-12-1 报数

¥1-3 SWUST oj 942: 逆置顺序表

How to deploy the jar package to the server? Note: whether the startup command has nohup or not has a lot to do with it

在Ubuntu中安装MySQL并创建新用户

Read and write mongodb database files

Thick willow dustpan, thin willow bucket, who hates reptile man? Asynchronous synergism, half a second to strip away a novel

CentOS changes MySQL database directory

~4.2 ccf 2021-12-1 序列查询

Idea hot deployment

使用nexus3发布yum私服(离线-内网)
随机推荐
*6-1 CCF 2015-03-2 数字排序
Week summary
机器学习 —— Sklearn包中StandardScaler()、transform()、fit()的详细介绍
Redis的十大常见应用场景
最短路问题 Bellman-Ford(单源最短路径)(图解)
MySQL的索引、视图与事务
[GPLT] 2022 大众情人(floyd)
前台页面打印
Numpy array attribute, shape changing function, basic operation
【代码源】每日一题 添加括号
深入理解static关键字
Click to hide the column in wechat applet, and then click to show it
Detailed explanation of the use of nanny scanner class
单例模式(Singleton)
Reverse Integer
[GYCTF2020]Node Game
[De1CTF 2019]SSRF Me
Go基础3
Analysis of concat and group in MySQL_ Use of concat
MySQL takes the query result as the data updated by update, and concatenates it after the original field data (Lej)