Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have just installed Ubuntu on my server and MySQL.

I can't make any change in MySQL (seeting password, creating database, etc.) as I ALWAYS get an Access denied error message. I have followed the MySQL manuals re passwords, but to no avail.

The user name I use is the account name created when Ubuntu was installed.

At some point, I am told I need SUPER privileges to do this or that but I can't change the privileges since I get the same error message. I can't even see the GRANTS as I also get the same access denied message. mysql version 14.14 Dist. 5.5.32, for debian-linux-gnu

Any idea on how to solve this?

To Arka:

Editing my own question is the only option I have to post this:

mysql> status

mysql Ver 14.14 Distrib 5.5.32, for debian-linux-gnu (i686) using readline 6.2
Connection id: 63
Current database:
Current user: charles@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.5.32-0ubuntu0.12.04.1 (Ubuntu)
Protocol version: 10
Connection: localhost via UNIX socket
Server characterset: latin1
Db characterset: latin1
Client characterset: utf8
Conn. characterset: utf8
UNIX socket: /var/run/mysqld/mysqld.sock
Uptime: 6 hours 58 min 20 sec
Threads: 1 
Questions: 165 
Slow queries: 0 
Opens: 211 
Flush tables: 1 
Open tables: 51 
Queries per second avg: 0.006

Now, I have not been able to create a single database since the installation of the server this morning. I hope that helps. Thanks. :)

share|improve this question
    
Which MySQL client are you using ? The command-line mysql one ? Do you know your MySQL root password (it's not the same as the system's root password) ? –  André Daniel Sep 23 '13 at 18:02
    
Please share the output. > mysql > status; –  Arka Bhattacharjee Sep 23 '13 at 18:26
    
I am working directly with the server, either at the shell prompt ($) with phpmyadmin or after logging into the mysql server (mysql>) However, I can log into mysql without a password (but I did set up a password when I installed it. Puzzling and confusing... :) –  user14666 Sep 23 '13 at 22:13
    
To Arka: Editing my own original question is the only way for me to answer you. Thanks. :) –  user14666 Sep 23 '13 at 22:48

1 Answer 1

When you're installing MySQL you're asked to enter the root password that you want to set for the database. In the status code you've listed above you're logging in as charles@localhost and not root. That's the reason why it's not asking for the password you set during installation.

If you're logging in to MySQL using the root account then you can do all the things you want.

Simply type:

mysql -p -u root

and it'll ask you for the root password. Now you're "in" the system with full access. You can then create databases using:

CREATE DATABASE MyNewDatabase;

If you have a user that you want to give access to this new database you can type:

GRANT ALL ON MyNewDatabase.* TO 'charles'@'localhost';

When this is done you should be able to login as charles and also have full access to the newly created database.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.