[RESOLVED]MariaDB can not create DB (beginer ...)

Support/Development for MySQL, MariaDB, and other database systems
kimilie
New Forum User
New Forum User
Posts: 4
Joined: Fri Sep 26, 2014 5:45 pm
Location: Muret

[RESOLVED]MariaDB can not create DB (beginer ...)

Unread post by kimilie »

Hello,

I am on ubuntu 14.04 and I have great problems to start using mariaDB, maybe because I'm new user.

I have installed Mariadb and no passwords creation or whatever was asked to me. But, I think it is well installed because I can start it with the following command :

Code: Select all

kimilie@kimilie-MS-7816:~$ sudo service mysql start 
[sudo] password for kimilie: 
 * Starting MariaDB database server mysqld                               [ OK ] 
At first, I wanted to create a database by using terminal with the following command :

Code: Select all

kimilie@kimilie-MS-7816:~$ CREATE DATABASE database;
CREATE: command not found
kimilie@kimilie-MS-7816:~$ 
But as you can see, it is not possible for me ....

So, I have installed PHPmyAdmin in order to create this DB ... but PhpMyAdmin always asks me username and password that I do not have because It was not asked to me to create password ! So I do not have one ....

I have rode the MariaDB documentation (first step) but it is also asked for pwd ... as you can see here : https://mariadb.com/kb/en/mariadb/docum ... ogging-in/
What can I do please ? I really want to go ahead with those problems but it seems it's too hard for me, I cannot understand why It's asked me a pwd when I never created one ?!?

:roll:

Thank you !
Last edited by kimilie on Sat Sep 27, 2014 2:45 pm, edited 1 time in total.
scott
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 8355
Joined: Wed Dec 31, 1969 8:00 pm
Location: earth
Contact:

Re: MariaDB can not create DB (beginer ...)

Unread post by scott »

You need to log into mysql:

Code: Select all

mysql -u root
and the run your mysql commands

Code: Select all

CREATE DATABASE database;
kimilie
New Forum User
New Forum User
Posts: 4
Joined: Fri Sep 26, 2014 5:45 pm
Location: Muret

Re: MariaDB can not create DB (beginer ...)

Unread post by kimilie »

Hello !

Thank you for your reply.

When I try to connect via root user, I get this error :

Code: Select all

kimilie@kimilie-MS-7816:~$ mysql -u root
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")
Thank you for your help !

:cry:
kimilie
New Forum User
New Forum User
Posts: 4
Joined: Fri Sep 26, 2014 5:45 pm
Location: Muret

Re: MariaDB can not create DB (beginer ...)

Unread post by kimilie »

Hello,

Thank you for your reply !

I tried this code but got an error :

Code: Select all

kimilie@kimilie-MS-7816:~$ mysql -u root
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")
It's really hard for me to connect when I do not have a password. In fact, no passwords were asked me to create during the install ....
:cry:
kimilie
New Forum User
New Forum User
Posts: 4
Joined: Fri Sep 26, 2014 5:45 pm
Location: Muret

Re: MariaDB can not create DB (beginer ...)

Unread post by kimilie »

Hello out there !

My problem is solved !

Here is the way I've solved the problem :

Code: Select all

kimilie@kimilie-MS-7816:/$ sudo /etc/init.d/mysql stop
 * Stopping MariaDB database server mysqld                                                                                                       [ OK ] 
kimilie@kimilie-MS-7816:/$ sudo mysqld_safe --skip-grant-tables --skip-networking &
[1] 4724
kimilie@kimilie-MS-7816:/$ 140927 20:15:56 mysqld_safe Logging to syslog.
140927 20:15:56 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

#plus de kimilie@… ; donc écrire direct sans attendre

mysql mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 10.0.13-MariaDB-1~trusty-log mariadb.org binary distribution

Copyright (c) 2000, 2014, Oracle, SkySQL Ab and others.

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

MariaDB [mysql]>update user set password=password('M4c4D4M*') where user="root" and host="localhost";
Query OK, 1 row affected (0.01 sec)
Rows matched: 1  Changed: 1  Warnings: 0

MariaDB [mysql]> exit
Bye
kimilie@kimilie-MS-7816:/$ sudo /etc/init.d/mysql start
 * Starting MariaDB database server mysqld                                                                                                       [ OK ] 
kimilie@kimilie-MS-7816:/$ mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 5
Server version: 10.0.13-MariaDB-1~trusty-log mariadb.org binary distribution

Copyright (c) 2000, 2014, Oracle, SkySQL Ab and others.

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

MariaDB [(none)]> 
Enjoy !!!
Post Reply