Instructions for Setting Up a MySQL User Account
For the MySQL examples to execute correctly, you need to set up a user account that al-lows users to create, delete and modify a database. After MySQL is installed, follow the steps below to set up a user account (these steps assume MySQL is installed in its default installation directory):
1. Open a Command Prompt and start the database server by executing the com-mand mysqld-nt.exe. (On Linux, execute mysqld start from a shell or terminal window.) Note that this command has no output—it simply starts the MySQL server. Do not close this window—doing so terminates the server.
2. Next, you’ll start the MySQL command-line client tool so you can set up a user account, open another Command Prompt and execute the command
mysql -h localhost -u root
The -h option indicates the host (i.e., computer) on which the MySQL server is running—in this case your local computer (localhost). The -u option indicates the user account that will be used to log in to the server—root is the default user account that is created during installation to allow you to configure the server. Once you’ve logged in, you’ll see a mysql> prompt at which you can type com-mands to interact with the MySQL server.
3. Next, you’ll add the iw3htp4 user account to the mysql built-in database. To cre-ate the iw3htp4 user account with the password iw3htp4, execute the following commands from the mysql> prompt:
create user 'iw3htp4'@'localhost' identified by 'iw3htp4';
grant select, insert, update, delete, create, drop, references, execute on *.* to 'iw3htp4'@'localhost';
This creates the iw3htp4 user with the privileges needed to create the databases used in this chapter and manipulate those databases.
4. Type the command
to terminate the MySQL monitor.
Copyright © 2018-2020 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.