Feel free to email me with any comments or feedback about what I have written here on this page.
Setting up a database for access from a networked computer
On the Server (Machine running MySQL)..
Start the MySQL client as shown with the following command line parameters
mysql -h localhost -u root
Create the database (if not already created)..
create database databaseName;
Grant access to a user on a networked computer..
grant all on databaseName.* to 'userName'@'networkedComputerName' identified
by 'password';
NOTE: I have made the mistake of specifiying the the userName and networkedComputerName as
'userName@networkedComputerName'. This does not work and took me a little while to
figure out that I had the wrong syntax. You must enter in all the single quote marks shown
for this to work properly.
On the Networked Computer..
Start the MySQL client as shown with the following command line parameters to connect to the Server
running MySQL ..
mysql -h serverName -u userName -p
You will be prompted for your password.
Change to the database that you were granted access to above..
use databaseName;
At this point you can issue any database commands you want to and run scripts from the networked computer in
addition to the server.
Resetting the Auto Increment vlaue on an ID column.
This can be very useful during development and testing.
Issue the following SQL command where [tbl_name] is the name of the table you want to reset...