MySQL has a refined security scheme, see MySQL: administration of users, but some time is necessary to allow a user to connect to our MySQL server from any computer on the Local Area Network, let's have a development server: devsrv and can make ssh:
1. Connect to devsrv via ssh
$ ssh desrv
2. We access the MySQL Server (localhost) as root
$ mysql -u root -p
3. Set permission to the usr: sedlav
grant all on *.* to 'sedlav'@'172.16.2.%' identified by 'clave';
Note:
– We set to the users sedlav, all permissions to all databases and perhaps this is not desired it, adjust the privileges according your needs.
-172.16.2. % is my LAN set this value to your working environment
4. Refresh privileges
flush privileges;
Recommended reading
-help grant (MySQL)
-help flush (MySQL)
Administering MySQL from the command line, 14 (15)
- How to install MySQL 5.7 on CentOS 7
- How to install MySQL 8.0 in Ubuntu 20.04
- How to install MySQL 8.0 in Debian
- How to install MariaDB on Alpine Linux
- How to install MariaDB on NetBSD?
- MySQL 8.0, change root password
- MySQL server administration – Basic
- Create / modify / delete tables in MySQL
- MySQL user administration
- MySQL – Execute SQL script
- Disable innodb engine in MySQL
- Show MySQL storage engines
- Character set available in MySQL
- Connect to a MySQL server from the LAN
- MySQL can not write in the /tmp dir