0% found this document useful (0 votes)
24 views2 pages

Mysql Experience

To access a MySQL database remotely, create a new admin user with specific privileges instead of using the root user, and ensure the server is configured to accept connections from remote hosts. Additionally, modify the MySQL configuration file to set the bind-address to 0.0.0.0 and restart the MySQL service. This process does not require a database reboot and includes commands for user creation and privilege granting.

Uploaded by

karthik76
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views2 pages

Mysql Experience

To access a MySQL database remotely, create a new admin user with specific privileges instead of using the root user, and ensure the server is configured to accept connections from remote hosts. Additionally, modify the MySQL configuration file to set the bind-address to 0.0.0.0 and restart the MySQL service. This process does not require a database reboot and includes commands for user creation and privilege granting.

Uploaded by

karthik76
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

1. How do you access DB from remote.

Once you created mysql, You should create new admin user and give rights.
You can not use root user on remote connection.

mysql> select user from user;


+------------------+
| user |
+------------------+
| [Link] |
| [Link] |
| [Link] |
| root |
+------------------+
4 rows in set (0.00 sec)

mysql> CREATE USER 'mysqladmin'@'localhost' IDENTIFIED BY 'mysqladmin123';


Query OK, 0 rows affected (1.50 sec)

mysql> CREATE USER 'mysqladmin'@'%' IDENTIFIED BY 'mysqladmin123';


Query OK, 0 rows affected (0.47 sec)

mysql> select user from user;


+------------------+
| user |
+------------------+
| [Link] |
| [Link] |
| [Link] |
| mysqladmin |
| mysqladmin |
| root |
+------------------+
5 rows in set (0.00 sec)

mysql> GRANT ALL PRIVILEGES ON *.* TO 'mysqladmin'@'localhost'WITH GRANT OPTION;


Query OK, 0 rows affected (0.26 sec)

mysql> GRANT ALL PRIVILEGES ON *.* TO 'mysqladmin'@'%';


Query OK, 0 rows affected (0.10 sec)

mysql> FLUSH PRIVILEGES;


Query OK, 0 rows affected (0.30 sec)

Note : The above method does not require to reboot the DB.

2. How do you fix while connecting the above from windows - DB Elite even the above
not working

Fix :

[root@kpr [Link].d]# pwd


/etc/[Link].d
[root@kpr [Link].d]# tail -8 [Link]
# instructions in [Link]

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/[Link]
log-error=/var/log/mysql/[Link]
pid-file=/run/mysqld/[Link]
bind-address = [Link]

[root@kpr [Link].d]#
sudo systemctl mysql.d restart

3.

You might also like