Difference between revisions of "Mysql"

From rbachwiki
Jump to navigation Jump to search
(Created page with "==Create mysql database in ubuntu shell== <pre> On a default settings, mysql root user do not need a password to authenticate from localhost. In this case, ou can login as roo...")
 
(Replaced content with "=DADABIK= =MYSQL COMMANDS=")
Tag: Replaced
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
==Create mysql database in ubuntu shell==
=[[DADABIK]]=
<pre>
=[[MYSQL COMMANDS]]=
On a default settings, mysql root user do not need a password to authenticate from localhost. In this case, ou can login as root on your mysql server using:
 
$ mysql -u root
 
If a password is required, use the extra switch -p:
$ mysql -u root -p
Enter password:
 
Now that you are logged in, we create a database:
mysql> create database amarokdb;
Query OK, 1 row affected (0.00 sec)
 
We allow user amarokuser to connect to the server from localhost using the password amarokpasswd:
mysql> grant usage on *.* to amarokuser@localhost identified by 'amarokpasswd';
Query OK, 0 rows affected (0.00 sec)
 
And finally we grant all privileges on the amarok database to this user:
mysql> grant all privileges on amarokdb.* to amarokuser@localhost ;
Query OK, 0 rows affected (0.00 sec)
 
And that's it. You can now check that you can connect to the MySQL server using this command:
$ mysql -u amarokuser -p'amarokpasswd' amarokdb
Your MySQL connection id is 12
Server version: 5.0.38-Ubuntu_0ubuntu1-log Ubuntu 7.04 distribution
 
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
 
mysql>
</pre>

Latest revision as of 19:49, 5 November 2021