473,480 Members | 1,813 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

I just ran /usr/bin/mysql_install_db and it told me to set a password for the MySQL root USER. I cannot.

MLH
I'm supposed to set a password for the MySQL root user. The output of
mysql_install_db instructed me to run the following commands...
/usr/bin/mysqladmin -u root -h appserver password mynwewpasswd
I did. It did not work. Here's the error:
/usr/bin/mysqladmin: connect to server at 'appserver' failed
error: 'Host 'appserver.crci.com' is not allowed to connect to this
MySQL server'

Another command I'm supposed to run also resulted in an error. Here
is the command and the ensuing error...
/usr/bin/mysqladmin -u root password mynewpassword
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: 'root@localhost' (Using password: NO)'

Can anyone tell me why I am getting these error messages and how
I can successfully set a password for the MySQL root user?

xxxxxxxxxxxxxxxxx mysql_install_db screen output xxxxxxxxxxxxxxxxxxx
Here's text of /usr/bin/mysql_install_db output to screen...

Installing all prepared tables

To start mysqld at boot time you have to copy
support-files/mysql.server
to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/etc/init.d/mysql start (you have to start the server first!)
/usr/bin/mysqladmin -u root -h appserver password 'new-password'
/usr/bin/mysqladmin -u root password 'new-password'
See the manual for more instructions.

NOTE: If you are upgrading from a MySQL <= 3.22.10 you should run
the /usr/bin/mysql_fix_privilege_tables. Otherwise you will not be
able to use the new GRANT command!

You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with the benchmarks in the 'sql-bench'
directory:
cd sql-bench ; perl run-all-tests

Please report any problems with the /usr/bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at https://order.mysql.com

Jul 23 '05 #1
5 4282
MLH wrote:
/usr/bin/mysqladmin -u root -h appserver password mynwewpasswd
I did. It did not work. Here's the error:
/usr/bin/mysqladmin: connect to server at 'appserver' failed
error: 'Host 'appserver.crci.com' is not allowed to connect to this
MySQL server'
This depends on the privileges set up for MySQL on that host. It's
certainly possible that it's configured to deny _any_ account from
connecting from another host. Or it could be that it's configured to
deny root when you don't supply a password.

The "-u root" without an accompanying "-p" means "I want to connect as
root, without giving a password." It's not unusual for people to
configure MySQL to disallow this.

The requirement to specify the "-p" option is there because MySQL also
allows you to configure accounts so that they _can_ connect without
requiring the password. You could even configure one account such that
if you don't specify a password, you get some limited privileges, but if
you do specify a password for the same account, you get a different set
of privileges! So there has to be a way to run the mysql commands both
with and without specifying a password. IMHO, the syntax they've chosen
to implement this feature isn't necessarily the most clear in
retrospect, but there might have been some historical reason for them to
do it the way they did.
/usr/bin/mysqladmin -u root password mynewpassword
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: 'root@localhost' (Using password: NO)'


This means that you tried to connect as root to set root's password, but
you specified no password. MySQL seems to want root's current
password before it'll let you do that.

Sounds like you should contact the person who sold you this server, and
ask what is the current MySQL root password.

Regards,
Bill K.
Jul 23 '05 #2
MLH
On Sun, 27 Mar 2005 20:06:13 -0800, Bill Karwin <bi**@karwin.com>
wrote:
MLH wrote:
/usr/bin/mysqladmin -u root -h appserver password mynwewpasswd
I did. It did not work. Here's the error:
/usr/bin/mysqladmin: connect to server at 'appserver' failed
error: 'Host 'appserver.crci.com' is not allowed to connect to this
MySQL server'


This depends on the privileges set up for MySQL on that host. It's
certainly possible that it's configured to deny _any_ account from
connecting from another host. Or it could be that it's configured to
deny root when you don't supply a password.

The "-u root" without an accompanying "-p" means "I want to connect as
root, without giving a password." It's not unusual for people to
configure MySQL to disallow this.

The requirement to specify the "-p" option is there because MySQL also
allows you to configure accounts so that they _can_ connect without
requiring the password. You could even configure one account such that
if you don't specify a password, you get some limited privileges, but if
you do specify a password for the same account, you get a different set
of privileges! So there has to be a way to run the mysql commands both
with and without specifying a password. IMHO, the syntax they've chosen
to implement this feature isn't necessarily the most clear in
retrospect, but there might have been some historical reason for them to
do it the way they did.
/usr/bin/mysqladmin -u root password mynewpassword
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: 'root@localhost' (Using password: NO)'


This means that you tried to connect as root to set root's password, but
you specified no password. MySQL seems to want root's current
password before it'll let you do that.

Sounds like you should contact the person who sold you this server, and
ask what is the current MySQL root password.

Regards,
Bill K.


xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxx
Thank-you very much, Bill. You are a genius. Everything you
said was right. I contacted the guy & he gave me the password.
I am successfully logging in now, on my way to completing the
objective of running source on the dump file, I'm sure. Here's
some screen capture showing you what I've successfully been
able to accomplish...

Script started on Mon Mar 28 13:16:04 2005
mlh@appserver mlh $ mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 15 to server version: 4.0.22

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

mysql> select user();
+---------------+
| user() |
+---------------+
| mlh@localhost|
+---------------+
1 row in set (0.00 sec)

mysql> quit
Bye
mlh@appserver mlh $ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 16 to server version: 4.0.22

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

mysql> select user();
+----------------+
| user() |
+----------------+
| root@localhost|
+----------------+
1 row in set (0.00 sec)

mysql> quit
Bye
mlh@appserver mlh $ su dewey
Password:
dewey@appserver mlh $ mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 17 to server version: 4.0.22

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

mysql> select user();
+-----------------+
| user() |
+-----------------+
| dewey@localhost |
+-----------------+
1 row in set (0.00 sec)

mysql> quit
Bye
dewey@appserver mlh $ exit
exit
mlh@appserver mlh $ exit

Script done on Mon Mar 28 13:24:24 2005

==> I am slightly confused about the return values from
the two ANONYMOUS logins shown above. I would have
expected the USER( ) function to return a name like
anonymous@localhost instead of mlh or dewey at localhost.
Is that considered normal?
Jul 23 '05 #3
MLH wrote:
==> I am slightly confused about the return values from
the two ANONYMOUS logins shown above. I would have
expected the USER( ) function to return a name like
anonymous@localhost instead of mlh or dewey at localhost.
Is that considered normal?


On Linux, yes. The "anonymous" login functionality allows you to
connect without providing a password. MySQL detects your username as
your Linux login, and the USER() function returns that string. MySQL
"trusts" that you have been authenticated by the operating system if you
got far enough to run the 'mysql' command.

This isn't very reliable or secure by many people's standards, though.
So for servers where security is considered important, one can disable
anonymous logins on their MySQL installations.
Read http://dev.mysql.com/doc/mysql/en/de...rivileges.html for more
information on that topic.

Regards,
Bill K.
Jul 23 '05 #4
Bill Karwin wrote:
On Linux, yes. The "anonymous" login functionality allows you to
connect without providing a password.


That's wrong. The anonymous login is not _necessarily_ passwordless,
though that is the configuration that ships with the product.

Sorry for the misinformation,
Bill K.
Jul 23 '05 #5
MLH
Misinformation that's now corrected. Who am I to complain?
Thx for helping out In another thread, I'm addressing the issue
of trying to telnet to the linux box over port 3306 (just to ensure
that port 3306 is really workikng for me). ... until my linux server
will respond to a command like
this: telnet 192.168.1.106 3306
I haven't got a snowball's chance of attaching to my mysql
tables on that same linux server, right? I'm afraid I don't know
how to configure the linux box to allow that, but that's a subject
for another news group. Let me see what I can find out and I'll
revisit this topic with this group after I can telnet in over port
3306. Thx.

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxx

On Thu, 31 Mar 2005 10:00:36 -0800, Bill Karwin <bi**@karwin.com>
wrote:
Bill Karwin wrote:
On Linux, yes. The "anonymous" login functionality allows you to
connect without providing a password.


That's wrong. The anonymous login is not _necessarily_ passwordless,
though that is the configuration that ships with the product.

Sorry for the misinformation,
Bill K.


Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1652
by: Doruk Fisek | last post by:
Hi, I am compiling MySQL 4.0.14 with GCC 3.2.3, Glibc 2.3.1 and Linux 2.4.21 on a x86. CFLAGS="-O2 -march=athlon" CXX=gcc CXXFLAGS="-march=athlon -O2 -felide-constructors" ./configure ...
0
1413
by: Simon | last post by:
Hi, I'm trying to get a version of MySQL 4.1.0 installed on my (Gentoo Linux) machine. I have a copy of MySQL 4.0.13 already installed, using Gentoo's ebuilds, but am trying to install 4.1.0 in...
0
1912
by: PiEmme | last post by:
On a Linux server a MySql db is installed. I was able to run mysql and mysqladmin without entering user and password, at first. Later both user and password have become required. Probably after...
0
12021
by: Ike_strong | last post by:
Can anyone help me to figure out why each time I try to access my database using: c:\mysql\bin\inmysql -root -p and afterwards:(i.e. after inputting my at the password prompt) Enter...
12
2831
by: Florian | last post by:
I've been stumbling over this, what I consider strange, behaviour. I installed mySQL on a Win2k machine and tried to change the root password, which didn't seem to work. I changed it this way: ...
1
3255
by: Adam Smith | last post by:
I have a new DB provided by my ISP don't know details of installation, setup etc. I can log in as anybody except root. mysql -h localhost -u mysql Welcome to the MySQL monitor. Commands end...
18
3134
by: Frances | last post by:
I want to learn PHP.. I know JSP, Servlets, have been using Tomcat for 2 years now, and even though I know there are ways you can use PHP in conjunction with Tomcat, I'd rather not tinker with...
7
161284
by: rajbala.3399 | last post by:
Hi , I want to download sql in my linux system........... # rpm -ivh MySQL-server-5.0.24a-0.glibc23.i386.rpm MySQL-cl ient-5.0.24a-0.glibc23.i386.rpm Preparing... ...
2
3785
by: ivytony | last post by:
First of all, I'm not sure if I've set up root password for MySQL server or not. I was following this tutorial http://www.howtoforge.com/centos-5.1-server-lamp-email-dns-ftp-ispconfig-p4 to install...
0
7033
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6903
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
6726
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6861
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5318
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4763
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4468
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
557
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
170
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.