LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
LinkBack Search this Thread
Old 03-10-2010, 03:02 AM   #1
Terry56
Member
 
Registered: Oct 2009
Posts: 49

Rep: Reputation: 15
mysqladmin: connect to server at 'localhost' failed(Confusion abot MySQL and mysqladm


Hi,
Hope you all are at good health.I have some confusion about mysqladmin and mysql.I am using mysql version
Quote:
[root@localhost freepbx-2.7.0]# mysql --version
mysql Ver 14.12 Distrib 5.0.77, for redhat-linux-gnu (i686) using readline 5.1
My MySQL is running
Quote:
[root@localhost freepbx-2.7.0]# /etc/init.d/mysqld status
mysqld (pid 11440) is running...
I have a root account named root and i am easily connect with it.When i try to execute command. I get the following error

Quote:
[root@localhost freepbx-2.7.0]# mysqladmin create asterisk
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
If i connect to mysql root account by mysql -u root -p and after that if i execute command then i get this

Quote:
[root@localhost freepbx-2.7.0]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 23
Server version: 5.0.77 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> mysqladmin create asterisk
-> ;
ERROR 1064 (42000): 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 'mysqladmin create asterisk' at line 1
mysql> mysqladmin create asterisk;
ERROR 1064 (42000): 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 'mysqladmin create asterisk' at line 1
mysql>
I want to ask why this command is not working
Quote:
[root@localhost freepbx-2.7.0]# mysqladmin create asterisk
Do i suppose to start mysqladmin like i start mysql(/etc/init.d/mysqladmin start or something like this)
I am using
Quote:
[root@localhost freepbx-2.7.0]# mysqladmin --version
mysqladmin Ver 8.41 Distrib 5.0.77, for redhat-linux-gnu on i686
Also in mysqladmin create asterisk. Is asterisk is a username or database name?
Thanks you.
 
Old 03-10-2010, 03:28 AM   #2
freelinuxtutorials
Member
 
Registered: Oct 2009
Posts: 68

Rep: Reputation: 21
you need to add username and password,
something like
Quote:
mysqladmin -u root -p create asterisk

Last edited by freelinuxtutorials; 03-10-2010 at 03:29 AM.
 
Old 03-10-2010, 03:37 AM   #3
Terry56
Member
 
Registered: Oct 2009
Posts: 49

Original Poster
Rep: Reputation: 15
Hi,
Thanks.Hmmm. Ok But i want to ask another thing Is mysql and mysqladmin are two different things? Means do both have their own users? The user created on mysql is different and user created on mysqladmin is different.

Thanks
 
Old 03-10-2010, 04:39 AM   #4
freelinuxtutorials
Member
 
Registered: Oct 2009
Posts: 68

Rep: Reputation: 21
If you have the same server communicating to, of course ,they have the same users. mysql and mysqladmin are just tools. basically mysqladmin from the word itself, is a client for administering the mysql server. mysqladmin is used normally to execute mysql commands in the CLI,not in the mysql prompt.This is very useful when creating shell scripts

I'll give you an example
objective: to show processlist
using mysql
1. #mysql -uroot -ppassword
mysql>show processlist;

using mysqladmin
# mysqladmin -u root -ppassword processlist

They will basically do the same thing
 
Old 03-10-2010, 07:20 AM   #5
arashi256
Member
 
Registered: Jan 2008
Location: Brighton, UK
Distribution: Ubuntu 12.04 / CentOS 6.5
Posts: 384

Rep: Reputation: 61
"mysqladmin" is a command-line tool to enable certain administrative tasks on the MySQL server running on that machine. "mysql" is the command-line *client* which allows you to login to the MySQL server (which may or may not be on the same machine) to perform whatever tasks you want.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
mysql error connect to server at 'localhost' failed pete44904 Linux - Server 10 11-23-2012 06:08 AM
How to fix "mysqladmin: connect to server at 'localhost' failed"? timiao Linux - Software 4 11-07-2009 10:16 PM
Can't connect to (non localhost) mysql server from laptop or desktop. DiBosco Linux - Server 9 01-20-2008 12:32 PM
mysqladmin: connect to server at 'localhost' failed... bluetxxth Fedora 4 10-07-2007 10:42 AM
mysqladmin localhost pass failed tommytomato Linux - Newbie 9 08-15-2004 07:08 PM


All times are GMT -5. The time now is 04:34 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration