Web Tool Bag  
Home · Articles · Downloads · Discussion Forum · Web Links · News Categories · Synonyms DatabaseJanuary 18 2018 16:07:43
Discussion Forum
Web Links
News Categories
Synonyms Database
Users Online
Guests Online: 1
No Members Online

Registered Members: 856
Unactivated Members: 118
Newest Member: lakim
Forum Threads
Newest Threads
Uncaught Error: _reg...
Module build failed:...
mochi script questions
Redirect with captch...
Hottest Threads
Installation [12]
Any questions and... [5]
Captcha picture d... [4]
Integrate with Vi... [4]
Mods: Sucess/Than... [4]
Latest Articles
PHP Fatal error: Ca...
Mouse pointer disapp...
UBUNTU install via U...
Geany tried to acces...
How to create MySql ...
How to create MySql user via terminal in Linux

Login to MySQL

1st you must login to the MySQL server from the terminal with the following command:

mysql -u root -p

In this case is used user root with the -u option, and then used the -p option so in this way MySQL prompts for a password. Please, enter your root user password to complete the login.

You should now be logged in MySQL prompt, this prompt looks very like this:

Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 7251 Server version: 5.5.41-0ubuntu0.14.10.1 (Ubuntu)

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


Create MySQL User

In the following example you will create a user with the name "exampleuser", and the password example123password!

CREATE USER 'exampleuser'@'localhost' IDENTIFIED BY 'example123password!';

Here is it, congratulations! You already are you have created your first MySQL user. However, this user can not do anything with MySQL until are not granted additional privileges. So here you will find how to do this:

Grant permissions

Here is a short list of commonly used permissions :

Allow a user to:
ALL – complete access to a specific database. If a database is not specified, then allow complete access to the entirety of MySQL.
CREATE – create databases and tables.
DELETE – delete rows from a table.
DROP – drop databases and tables.
EXECUTE – execute stored routines.
GRANT OPTION – grant or remove another user’s privileges.
INSERT – insert rows from a table.
SELECT – select data from a database.
SHOW DATABASES - view a list of all databases.
UPDATE – update rows in a table.

GRANT CREATE ON *.* TO 'exampleuser'@'localhost';
GRANT DROP ON tutorial_database.* TO 'exampleuser'@'localhost';

To List/View Grants for MySQL User please, use the following command: SHOW GRANTS FOR 'exampleuser'@'localhost';

Posted by admin on March 20 2015 15:05:41 7486 Reads · Print


Not a member yet?
Click here to register.

Forgotten your password?
Request a new one here.
Member Poll
Which PHP framework do you preffer?





eZ Components






You must login to vote.
You must login to post a message.

03/10/2011 21:17
Hi, How to remove Register from Login screen? I don't want them to register and have full access! if you leave register then they should not have any rights until the admin assigns them

26/09/2011 11:28
Please describe your problem with more details. Thank you.

22/11/2010 20:31
Help. There was a problem with the request; error regarding feedbackzdr form program

Copyright © 2018 - www.webtoolbag.com