当前位置:网站首页>Ubuntu and MySQL quick start tutorial
Ubuntu and MySQL quick start tutorial
2022-07-27 10:17:00 【Xiang Yu Han】
Write it at the front , as everyone knows , ECS is quite popular in the era , Create your own virtual cyberspace , I am full of expectations .
This article explains the existing Cloud server Under the premise of , This paper introduces the creation of a complete database and the cognition of user management , These are contents that cannot be accessed by large companies . after , Will fully introduce how to use springboot Set up the project , And design 、 Research and development 、 Test and release a app Or a little program , Understand the process and connection matters of each link of project management .
A little flowers , Go straight to the point :
One 、 install mysql
sudo apt update
to update apt Indexes ;
sudo apt install mysql-server
install mysql database , All the way 【yes】 down , No password setting option ;
sudo mysql_secure_installation
Run security scripts , Password detection plug-in 、 Set the password ;
mysql -V
Show installation mysql Information about , for example : edition 、 System ;
Two 、 modify root User login method
sudo mysql
Get into mysql database ;
SELECT user,authentication_string,plugin,host FROM mysql.user;
Show the authentication methods of all users 【 Two types of : Password authentication 、auth_socket Plug in authentication 】;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY ' Your database password ';
by root User set password ;
FLUSH PRIVILEGES;
take effect ;
SELECT user,authentication_string,plugin,host FROM mysql.user;
Check whether it is effective ;
exit;
sign out ;
sudo mysql;
Report errors , Because it has been changed to password authentication login ;
mysql -u root -p
Password authentication login , Just enter the password ;
3、 ... and 、 establish 、 Delete database
mysql -u root -p;
Use root Role users log into the database ;
show databases;
Show database list ;
create database srping;
Create a srping The database of ;
create database test;
Create a test The database of ;
show databases;
Show database list , You can see that the above two databases have been created ;
drop database test;
Delete the name test The database of ;
show databases;
Show database list , Verify that the deletion was successful ;
Four 、 Create a new user , And authorize Authority
mysql -u root -p
Input password , Login database ;
CREATE USER 'xiaochun'@'localhost' IDENTIFIED BY ' Your high-strength password ';
Create user name as xiaochun Users of , And set the password as 【 Your high-strength password 】
show grants for 'xiaochun'@'localhost';
Show spring User's rights , Because permission is not granted , You can see the default permissions :
// GRANT USAGE ON *.* TO 'xiaochun'@'localhost'
// namely USAGE( Only login is allowed )
exit;
sign out ;
mysql -u xiaochun -p
Verify whether you can log in , Input password , Login database ;
exit;
sign out ;
mysql -u root -p
Replace with root user ;
// Introduce the format of authorization command : grant A on B to C
// A: User operation permission ,SELECT,INSERT,UPDATE,privileges,all ,USAGE( Only login is allowed )
// B: Authorized person ,*.* Represents all databases, all tables ; You can also specify a database 、 Table under database
// C: user name
grant all privileges on spring.* to 'xiaochun'@'localhost';
Give to users 【xiaochun】 Give the database the name 【 spring】 All operation rights ;
flush privileges;
Refresh permission table ;
show grants for 'xiaochun'@'localhost';
Check for authorization ;
exit;
sign out ;
mysql -u xiaochun -p
Change user login ;
show grants for 'xiaochun'@'localhost';
Verify whether authorization is given ;
exit;
thus , All training items are introduced , Next class , Introduce window Connect the remote server database locally under the platform .
Add
Revoke user privileges
REVOKE privilege ON databasename.tablename FROM 'username'@'host';
explain :
privilege, databasename, tablename: Same authorization part
Example :
REVOKE SELECT ON *.* FROM 'pig'@'%';
Set and change user passwords
SET PASSWORD FOR 'username'@'host' = PASSWORD('newpassword');
If it is the current login user :
SET PASSWORD = PASSWORD("newpassword");
Example :
SET PASSWORD FOR 'pig'@'%' = PASSWORD("123456");
边栏推荐
- Anchor free detector: centernet
- Reason for pilot importerror: cannot import name 'pilot_ Version 'from' PIL ', how to install pilot < 7.0.0
- Shell变量、系统预定义变量$HOME、$PWD、$SHELL、$USER、自定义变量、特殊变量$n、$#、$*、[email protected]、$?、env看所有的全局变量值、set看所有变量
- Girl fan wants to find a boyfriend, but it's for
- mount.nfs: access denied by server while mounting解决
- 程序的翻译和执行,从编辑、预处理、编译、汇编、链接到执行
- Summary of binary tree exercises
- 解决ORCLE-ORA-01122 01110 01210
- Shell综合应用案例,归档文件、发送消息
- Switch port mirroring Configuration Guide
猜你喜欢

SE(Squeeze and Excitation)模块的理解以及代码实现

Shell综合应用案例,归档文件、发送消息

hdu5288(OO’s Sequence)

There is no CUDA option in vs2019+cuda11.1 new project

vs2019社区版下载教程(详细)
[email protected], "/>Shell variables, system predefined variables $home, $pwd, $shell, $user, custom variables, special variables $n, $, $*, [email protected],

Food safety | the more you eat junk food, the more you want to eat it? Please keep this common food calorimeter

Oracle调整数据文件大小杂谈

Data visualization

When I went to oppo for an interview, I got numb
随机推荐
Text processing tool in shell, cut [option parameter] filename Description: the default separator is the built-in variable of tab, awk [option parameter] '/pattern1/{action1}filename and awk
mount.nfs: access denied by server while mounting解决
Practice and exploration of overseas site Seata of ant group
使用 Kmeans聚类实现颜色的分割
About new_ Online_ Judge_ 1081_ Thoughts on Goldbach's conjecture
open3d库的安装,conda常用指令,导入open3d时报这个错误Solving environment: failed with initial frozen solve. Retrying w
Fsm onehot 答题记录
ACL2021最佳论文出炉,来自字节跳动
SE(Squeeze and Excitation)模块的理解以及代码实现
Food safety | the kitchen board environment is very important. Do you know these use details?
window平台下本地连接远程服务器数据库(一)
达梦 PARTGROUPDEF是自定义的对象吗?
Matlab/Simulink求解微分方程样例分享
Metaaploit-后渗透技知识
Shell integrated application cases, archiving files, sending messages
Matlab绘制不同阻尼下的系统响应
Matlab-离散事件系统仿真实验
Shell的正则表达式入门、常规匹配、特殊字符:^、$、.、*、字符区间(中括号):[ ]、特殊字符:\、匹配手机号
Visual slam lecture notes (I): Lecture 1 + Lecture 2
Acl2021 best paper released, from ByteDance