Java Reference
In-Depth Information
32.3.1 Creating a User Account on MySQL
Assume that you have installed MySQL 5 with the default configuration. To match all the
examples in this topic, you should create a user named scott with the password tiger . You can
perform the administrative tasks using the MySQL Workbench or using the command line.
MySQL Workbench is a GUI tool for managing MySQL databases. Here are the steps to cre-
ate a user from the command line:
1. From the DOS command prompt, type
mysql -uroot -p
You will be prompted to enter the root password, as shown in Figure 32.7.
2. At the mysql prompt, enter
use mysql;
3. To create user scott with password tiger , enter
create user 'scott'@'localhost' identified by 'tiger';
4. To grant privileges to scott , enter
grant select, insert, update, delete, create, create view, drop,
execute, references on *.* to 'scott'@'localhost';
If you want to enable remote access of the account from any IP address, enter
grant all privileges on *.* to 'scott'@'%'
identified by 'tiger';
If you want to restrict the account's remote access to just one particular IP address,
enter
grant all privileges on *.* to 'scott'@'ipAddress'
identified by 'tiger';
5. Enter
exit;
to exit the MySQL console.
F IGURE 32.7
You can access a MySQL database server from the command window.
 
 
Search WWH ::




Custom Search