Learning Mysql



Download 4.24 Mb.
View original pdf
Page284/366
Date04.08.2023
Size4.24 Mb.
#61806
1   ...   280   281   282   283   284   285   286   287   ...   366
Learning MySQL
Users and Hosts | 309

If the web server and the database server are on different computers, you have to allow the web application on the web server to connect remotely to the database server, as shown in Figure 9-4. Database server software
User with web browser
User with web browser
User with web browser
Web database application
Local access to database server
Web server software
Host running database and web servers
Figure 9-3. Database server and web application the web application has local access to the database
server, and the managers computers interact with the database through the web application
Database server software
User with web browser
User with web browser
User with web browser
Web database application
Remote access to database server
Web server software
Host running database server
Host running web server
Figure 9-4. Web application, web server, and database server configured for remote access
310 | Chapter 9:
Managing Users and Privileges


Creating a New Remote User
If you want to allow a user to connect to the server from another computer, you must specify the host from which they can do so (the remote client. Suppose that you have a home network, that your machine has the private IP address 192.168.1.2, that your home domain is invyhome.com, and that your machine is named ruttle
(that is, its complete name is ruttle.invyhome.com
). Let’s also assume that you’re running a
MySQL server on ruttle
, and that there are two other machines on the network:
toorak.invyhome.com with the IP address 192.168.1.4 and yazd.invyhome.com with IP
address Figure 9-5 illustrates this setup. Again, we differentiate between user accounts on the
MySQL server (MySQL users or MySQL accounts) and user accounts on the host machines (system users or system accounts).
Now, let’s consider the MySQL setup on ruttle
. Let’s assume you’ve previously logged into the MySQL server on ruttle as the root user and created the user hugh with the statement:
mysql> GRANT ALL on *.* TO 'hugh'@'localhost' IDENTIFIED BY 'the_password';
Query OK, 0 rows affected (0.00 sec)
If you’re logged into your system account on ruttle
, you can connect to the MySQL
server on ruttle using the following mysql --host=localhost --user=hugh --password=the_password
Database server software
Network ruttle.invyhome.com (192.168.1.2)
toorak.invyhome.com (192.168.1.4)
yazd.invyhome.com (192.168.1.6)
Figure 9-5. A simple home network with three computers, and one MySQL server

Download 4.24 Mb.

Share with your friends:
1   ...   280   281   282   283   284   285   286   287   ...   366




The database is protected by copyright ©ininet.org 2024
send message

    Main page