LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   mysql administrator in linux (http://www.linuxquestions.org/questions/linux-newbie-8/mysql-administrator-in-linux-452608/)

Ameii83 06-07-2006 09:37 PM

mysql administrator in linux
 
hi all, i got problem to create a user mysql account, when i type in the command prompt "mysql --user=root mysql" it keep saying " ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) "

phoenix49 06-07-2006 11:25 PM

Quote:

Originally Posted by Ameii83
hi all, i got problem to create a user mysql account, when i type in the command prompt "mysql --user=root mysql" it keep saying " ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) "

I think you should add password parameter (-p I guess)

Ameii83 06-08-2006 02:43 AM

it ask me for the password!!i don't have it..what is the password ??" What i missing here ?. Do i forgot something! can somebody give the proper/full command line..how to get into this ?? :)

phoenix49 06-08-2006 02:59 AM

Take a look at here:

http://stanton-finley.net/fedora_cor...tes.html#MySQL

You should create initial password for root, anyway, link above will explain everything you need to start using mysql

Ameii83 06-08-2006 03:21 AM

It say "Access denied for user 'root'@'localhost'". Why this is happen??.This is the example that
i go through ..step by step with the link above

////////////////////////////////////////////////////////////////////////////////////////////////

[sys@xxxx ~]$ sudo su -
Password:
[root@xxxx ~]# cd /
[root@xxxx /]# vi /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
skip-innodb

[mysql.server]
user=mysql
basedir=/var/lib

[mysqld_safe]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
~
~
~
~
~
~
~
~
"/etc/my.cnf" 15L, 357C written
[root@xxxx /]# mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

////////////////////////////////////////////////////////////////////////////////////////////

can you check it for me??

MasterC 06-08-2006 03:43 AM

What distribution are you running? Is this on a computer you setup, or is this a hosting provider or a remote machine? It appears you are running as root, so I'd guess at least that you have actual root access to this machine. In a blindingly way off attempt to get in, I'd try your root password:
mysql -u root -p

And enter your root password. Your other options are outlined on this page:
http://www.alt-php-faq.org/local/70/

HTH

Cool

Ameii83 06-08-2006 04:06 AM

actually.. i'm controling the remote machine. I have try "mysql -u root -p", it ask me the password and then.. i enter my root password..but it keep saying .."ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)". What it means??

mat087 06-08-2006 08:49 AM

Use this to change your root password
Quote:

Do so:

service mysql stop

wait until MySQL shuts down. Then run

mysqld_safe --skip-grant-tables &

then you will be able to login as root with no password.

mysql -uroot mysql

In MySQL command line prompt issue the following command:

UPDATE user SET password=PASSWORD("abcd") WHERE user="root";
FLUSH PRIVILEGES;

At this time your root password is reset to "abcd" and MySQL will now
know the privileges and you'll be able to login with your new password:
Then login with your new password as you did before : "mysql -u root -p"

http://lists.mysql.com/mysql/171366


Works well for me,
Mathieu

Braynid 06-08-2006 09:25 AM

Hello, i get the same thing so i thought there was no need to start a different thread.
When i try what 'mat087' suggested i get:
Code:

root@:mysqld_safe --skip-grant-tables &
[1] 5979
root@:/var/run/mysqld# Starting mysqld daemon with databases from /var/lib/mysql
mysqld_safe[6040]: started
STOPPING server from pid file /var/run/mysqld/mysqld.pid
mysqld_safe[6053]: ended

I will keep trying but can you give me any hint?

I use Ubuntu server 6.06 RC. I am connecting trough ssh. in the /etc/mysql/my.cnf i tryed both with
Code:

bind-address          = 127.0.0.1
commented and uncommented.

mat087 06-09-2006 01:04 AM

I really don't know what the problem could be...
Do you stop mysql server before doing anything ?
Do you have anything else running that could be in conflict with mysqld_safe ?

I don't know why you mentioned that you're connected through ssh. But just in case that it can help you, I'm connected through ssh too, and the line "bind-address = 127.0.0.1" is uncommented.


Mathieu

Farrukh Fida 06-09-2006 03:14 PM

hi all
try the website
www.linuxhomenetworking.com
hope this will help u in mysql issue.


All times are GMT -5. The time now is 01:30 PM.