PDA

View Full Version : MySQL - The Perfect Set Up Fedora Core 4


Gem
22nd January 2006, 22:01
Hello..

I am in the process of setting up my server and am having a problem with the install for MySQL....I have followed the directions as posted and these are the errors that I am getting...

ERROR: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
060122 14:18:09 [ERROR] Aborting

and when trying to set the password for root I am getting this error...

error: 'Access denied for user 'root'@'localhost' (using password: NO)'

MySQL starts and stops OK, and I have even started the whole install of Fedora over and am getting the same errors...I have goggled to see what I can do to fix the problem, but can not seem to find anything.

Any help would be appreciated.

Thanks :)

till
22nd January 2006, 22:31
ERROR: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
060122 14:18:09 [ERROR] Aborting

When exactly did you get this error. Please post the command that results in this error.

Gem
22nd January 2006, 22:48
I got this error after typing in

/etc/init.d/mysqld start

edits to add I am still getting the 1064 error

mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'

falko
23rd January 2006, 00:12
edits to add I am still getting the 1064 error

mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
What's the exact command you ran that gave you this error?

Gem
23rd January 2006, 00:42
I used

mysqladmin -root password mypasswordhere

I also tried

SET PASSWORD FOR root = PASSWORD("mypassword");

and got the same error...

falko
23rd January 2006, 07:04
Have a look here: http://www.howtoforge.com/perfect_setup_fedora_core_4_p4

The correct command is
mysqladmin -u root password yourrootsqlpassword, not

mysqladmin -root password yourrootsqlpassword

Gem
23rd January 2006, 13:36
I'm sorry, that was a typo on my part, I was using the comand

mysqladmin -u root password yourrootsqlpassword

I even tried it again to make sure and I am getting the same error...

falko
23rd January 2006, 18:51
Have a look at this thread: http://www.howtoforge.com/forums/showthread.php?t=1581

Gem
24th January 2006, 01:14
I have read the thread that you posted and I am not sure that it really is going to help me. I have not tried to install ISPConfig yet because of the MySQL error that I am getting, plus the error that user was getting was:

ERROR:1045: Access denied for user:'root@localhost' (Using password:YES)
ERROR: The provided MySQL password is wrong! The installation routine stops here!

Mine is

mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'

I have not been able to create a password for root. I have tried to unistall MySQL to start over and it wont let me because of PHP, and that was before I got to the part of the install steps in the tut on PHP.

I have even gone as far as starting completly over with a fresh install of Fedroa and am still getting the same error. I am at a loss...and it is getting so frusterating....got to love it though...*grin*

Thanks for taking the time out and answering my questions...*S*

falko
24th January 2006, 09:52
Is MySQL listening on localhost? Please post the output of netstat -tap

What's in /etc/hosts?

Gem
24th January 2006, 13:49
Is MySQL listening on localhost? Please post the output of
Code:

netstat -tap



This is the output

Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 *:imaps *:* LISTEN 3554/xinetd
tcp 0 0 *:32769 *:* LISTEN 1661/rpc.statd
tcp 0 0 *:pop3s *:* LISTEN 3554/xinetd
tcp 0 0 *:mysql *:* LISTEN 4730/mysqld
tcp 0 0 *:pop3 *:* LISTEN 3554/xinetd
tcp 0 0 *:imap *:* LISTEN 3554/xinetd
tcp 0 0 *:sunrpc *:* LISTEN 1643/portmap
tcp 0 0 *:ftp *:* LISTEN 4060/proftpd: (acce
tcp 0 0 localhost.localdomain:ipp *:* LISTEN 1969/cupsd
tcp 0 0 localhost.localdomain:5335 *:* LISTEN 1951/mDNSResponder
tcp 0 0 *:smtp *:* LISTEN 3530/master
tcp 0 0 xxx.xxx.x.xxx:53321 xx.xxx.xx.80:http ESTABLISHED 3808/firefox-bin
tcp 1 0 xxx.xxx.x.xxx:59227 xmlrpc.rhn.redhat.com:https CLOSE_WAIT 2650/python
tcp 1 0 xxx.xxx.x.xxx:57897 xmlrpc.rhn.redhat.com:https CLOSE_WAIT 2650/python
tcp 0 0 *:http *:* LISTEN 3850/httpd
tcp 0 0 *:ssh *:* LISTEN 2017/sshd
tcp 0 0 *:https *:* LISTEN 3850/httpd


What's in /etc/hosts?

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost


Thanks so much for your help, I really appreciate it. :)

falko
24th January 2006, 21:54
Looks ok. Please restart MySQL. Do you have error messages in the logs in /var/log?

Please try these two commands to see if it makes any difference:

mysqladmin -h localhost -u root password yourrootsqlpassword

and

mysqladmin -h 127.0.0.1 -u root password yourrootsqlpassword

Gem
25th January 2006, 02:24
I tried both of those commands and got the same error:

mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'

and

mysqladmin: connect to server at '127.0.0.1' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'

Do you have error messages in the logs in /var/log?

I looked in the /var/log/mysqld.log and I am not seeing any errors.

Gem
25th January 2006, 03:21
Looking around the web I came across a site that said to try and change the root password by installing a database by typing the comand:

mysql_install_db

and then changing the password...

I tried this and got the following error after trying the istall comand and it would not let me any farther....:

Installing all prepared tables
Fill help tables
ERROR: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
060124 19:26:56 [ERROR] Aborting

060124 19:26:56 [Note] /usr/libexec/mysqld: Shutdown complete

Could this be the problem why I can not change the root pw? I have tried goggling to see how to fix this error and either I am not seeing it or I am just not understanding how to fix it....

Gem
27th January 2006, 04:44
I got it working. Thanks for your help...*S*

rupsshar
31st March 2006, 22:16
Gem,

I have run into the same problem.
Can you tell me how you fixed it?

I have fedora core 4, which comes with MySql 4.1.x version.
This was working fine until I upgraded it to 5.0.19

I can start the mysqld deamon without any errors, but cannot create a root password.

/usr/bin/mysqladmin -h localhost -u root password mypassword
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'

falko
1st April 2006, 13:23
It seems you don't have a password yet, so try this:

mysql -u root

rajayoganand
17th May 2006, 09:44
Dear all,

check the following
1. mysql Server is running?!!!
If running give the following command as root
# mysql

if it is showing Error like the following It meens the sql have root password set.
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

Other wise it will come to mysql prompt like ....
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

If the password is NOT set for user root you can do this simply by giving the following in command prompt of linux

# mysqladmin -u root password 'mynewpassword'

if you forget password you can do the following

# Take down the mysqld server by sending a kill (not kill -9) to the mysqld server. The pid is stored in a `.pid' file, which is normally in the MySQL database directory:

shell> kill `cat /mysql-data-directory/hostname.pid`

You must be either the Unix root user or the same user mysqld runs as to do this.
# Restart mysqld with the --skip-grant-tables option.
# Set a new password with the mysqladmin password command:

shell> mysqladmin -u root password 'mynewpassword'

# Now you can either stop mysqld and restart it normally, or just load the privilege tables with:

shell> mysqladmin -h hostname flush-privileges

# After this, you should be able to connect using the new password.


Alternatively, you can set the new password using the mysql client:

1. Take down and restart mysqld with the --skip-grant-tables option as described above.
2. Connect to the mysqld server with:

shell> mysql -u root mysql

3. Issue the following commands in the mysql client:

mysql> UPDATE user SET Password=PASSWORD('mynewpassword')
-> WHERE User='root';
mysql> FLUSH PRIVILEGES;

4. After this, you should be able to connect using the new password.
5. You can now stop mysqld and restart it normally.


Thank you
Regards.
help for all.....
rajayoganand
:)