Root password for mysql

justahost

Verified User
Joined
Mar 19, 2006
Messages
128
Probably a numpty question but when I try to use mysql in SSH i get the denied access for root@localhost error

How do I set up the password for it??

Cheers!
 
The mysql super username is set to da_admin
The command: 'mysql -u da_admin -p' will prompt you for the da_admin password

This password is the original password set by the DA install. If you don't know it check /usr/local/directadmin/conf/mysql.conf

If you change the da_admin password in mysql or phpMyAdmin you will need to change it in the mysql.conf file as well.
 
Hmmm, I have something along the same lines....

Here's a scenerio:

DB Name: yoda1_vb3
DB User: yoda1_user1
DB User Password: 12345

So, I have a dump I want to populate the DB with. The common command would be:

mysql -uyoda1_user1 -p12345 yoda1_vb3 <yoda1_file.sql.2

That should upload the file yoda1_file.sql.2 to the yoda1_vb3 DB.

It won't, access denied.

I can't use user=da_admin and passwd, that is not a valid user to the DB.

How do you upload a dump to a DB via ssh??
 
Also tried the follow 2 lines from ssh after searching the forum:

mysql -u yoda1_user1 -p12345 \
yoda1_vb3 < yoda1_file.sql

I get access denied:

ERROR 1044: Access denied for user: 'yoda1_user1@localhost' to database 'yoda1_vb3'

If I repace the uname and password with da_admin, it comes back with:

ERROR 1049: Unknown database 'yoda1_vb3'

Which makes sense because da_admin does not own that DB.

Really need some help on how to import this DB....

Thx!
 
I think the database yoda1_vb3 doesn't exist yet, hence the error da_admin gets, not because of lack of rights. The da_admin user should have the same rights as root, so he should have rights to the yoda1_vb3 database if it exists.

I think the problem is that your sql dump lacks a create database yoda1_vb3 statement, so you should add that at the top of the dump file and then try again with da_admin.

Ruben.
 
RD, thx for the reply. No, the DB and user did exist. Funny, though, when I logged into phpmyadmin as da_admin, I didn't see the DB's, either.

I was battling this for a day, I finally contacted my DC (and posted here)...told them about the issue. They added a .my.cnf file to roots directory, with just the following lines:

[client]
user="root"
pass="XXXXXXXXX"

Low and behold, that seemed to have worked. I can see everyones DB's via phpmyadmin, as well as able to upload the dumps via ssh.

Not exactly sure why that is, or perhaps they did more and didn't pass it on to me...but she's working and I'm a happy camper ;)
 
The user= and password= settings (and all other settings in the [client] section) are just passed to each mysql client.

So if that root password works, you should have been able to use it from the shell to like: mysql -u root -p with the same password.

But anyway great that it works now. :)

Ruben.
 
Back
Top