-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathINSTALL MYSQL DATABASE .txt
64 lines (38 loc) · 1.37 KB
/
INSTALL MYSQL DATABASE .txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
INSTALL MYSQL DATABASE,CREATE USER AND THEN CONNECT WITH DBeaver
Installation step: refer the website:
https://phoenixnap.com/kb/install-mysql-ubuntu-20-04
==> sudo apt update
==> sudo apt upgrade
==> sudo apt install mysql-server
==> mysql –version
Securing MySQL
After installation mysql in server
* sudo mysql (this command used)
* enter into the mysql
-->ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password by 'eccE2Hi3kl!7^'; (random passwd)
-->sudo mysql_secure_installation
Check if MySQL Service Is Running
==> sudo systemctl status mysql
Log in to MySQL Server
-->sudo mysql -u root
-->sudo mysql -u root –p
Configure mysql in server:
-->cd /etc/mysql/mysql.conf.d
==> vi mysqld.cnf
bind – address change globaly
-->bind-address : 0.0.0.0
Restart mysql server --> systemctl mysql restart
Create User:
==> CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
==> GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' WITH GRANT OPTION;
==> CREATE USER 'username'@'%' IDENTIFIED BY 'password';
==> GRANT ALL PRIVILEGES ON *.* TO 'username'@'%' WITH GRANT OPTION;
==> FLUSH PRIVILEGES;
Delete user command
==> DROP USER 'username'@'host';
List the user in mysql:
==> DESC mysql.user
Create database:
==> CREATE DATABASE database_name;
List show database:
==> SHOW DATABASES;