473,396 Members | 2,057 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to admin user in MySQL 5.0

Hi all,

I've just installed MySQL 5.0 on my sun box (runing Solaris 10, install
from blastwave). This is my first time with MySQL so I don't have any
exp with it.

I have some troubles as:
- I set password for root account via this command:

# mysql -h atlantis -u root mysql
mysql> update user set password=PASSWORD('123456') where user = 'root';
mysql> exit

However, I can login again with root account without pass check ????

- Next, I create new user name admin
# mysql -h atlantis -u root
mysql> create user admin identified by 'admin' ;
mysql> create database newdb ;
mysql> GRAND ALL ON newdb.* TO 'admin' IDENTIFIED BY 'admin' ;

Once again, i can't use admin account to login to newdb database??

Please help me to study them.

Thanks in advance.

Nov 27 '05 #1
11 20506
Hi,
# mysql -h atlantis -u root mysql
mysql> update user set password=PASSWORD('123456') where user = 'root';
mysql> exit
you need to flush the privileges to make MySQL read the grant tables into
memory.
mysql> GRAND ALL ON newdb.* TO 'admin' IDENTIFIED BY 'admin' ;

Don't you mean GRANT?
mysql> create user admin identified by 'admin' ;
mysql> create database newdb ;
mysql> GRAND ALL ON newdb.* TO 'admin' IDENTIFIED BY 'admin' ;


You should also specify the host to which the user belongs. For example, if
user admin should be able to log in from localhost, specify the user as
admin@localhost (or admin@'%' for all hosts, admin@'192.168.0.%' for all
hosts within the network range 192.168.0.x a.s.o.). So you could write

create user admin@localhost identified by 'admin';
create database newdb;
grant all on newdb.* to admin@localhost; (here you don't need 'identified
by' anymore, because you already specified it in the CREATE USER command)

You should also take care that there are no anonymous users (users without a
name, therefore take a look into the mysql.user table).

Find detailed information here:

http://dev.mysql.com/doc/refman/5.0/...ge-system.html
http://dev.mysql.com/doc/refman/5.0/...anagement.html

Markus
Nov 27 '05 #2
Oh my god, after i flushed the privileges, I can't login into mysql
again, I get this error message although my password is correct surely.

ERROR 1251: Client does not support authentication protocol requested
by server; consider upgrading MySQL client

????

Nov 28 '05 #3
AnhTai wrote:
Oh my god, after i flushed the privileges, I can't login into mysql
again, I get this error message although my password is correct surely.

ERROR 1251: Client does not support authentication protocol requested
by server; consider upgrading MySQL client


Read these pages:
http://dev.mysql.com/doc/refman/5.0/...-problems.html
http://dev.mysql.com/doc/refman/5.0/en/old-client.html

PHP does not support the enhanced password encryption format of MySQL
4.1 and later (astonishing but true!). You can run the MySQL server
with the --old-passwords option, and MySQL will use the 4.0-compatible
password encryption that PHP uses. If you do that, I expect you
probably will have to reset passwords again, for them to be encrypted in
the old format.

Regards,
Bill K.
Nov 28 '05 #4
However, I'm running MySQL 5.0 now and connect to mysql directly from
console (not used php). I got this error message when i tried:

#mysql -h atlantis -u root -p mysql
password: <my password>

Can I reset password via the other way?

Nov 28 '05 #5
AnhTai wrote:
However, I'm running MySQL 5.0 now and connect to mysql directly from
console (not used php). I got this error message when i tried:

#mysql -h atlantis -u root -p mysql
password: <my password>

Can I reset password via the other way?


Have you read this documentation page:

http://dev.mysql.com/doc/refman/5.0/en/passwords.html

It shows several methods for assigning passwords.

Regards,
Bill K.
Nov 28 '05 #6
I have read that page and understood how to set password for users.
However, I can't login into mysql console admin via the command:

# mysql -h atlantis -u root -p mysql
password: <my password>

Although I typed my password correctly, i got the error message:

ERROR 1251: Client does not support authentication protocol requested
by server; consider upgrading MySQL client

Nov 29 '05 #7
On Sun, 27 Nov 2005 18:20:36 -0800, AnhTai wrote:
Oh my god, after i flushed the privileges, I can't login into mysql again,
I get this error message although my password is correct surely.

ERROR 1251: Client does not support authentication protocol requested by
server; consider upgrading MySQL client

????


I think you need to download the mysql-clients package (you must be using
rpm or some other package manager). You seem to be using a client from a
4.0 package.
Mike A.

MySQL 5.0.15 on FreeBSD 5.4

Nov 29 '05 #8
On Sun, 27 Nov 2005 18:20:36 -0800, AnhTai wrote:
Oh my god, after i flushed the privileges, I can't login into mysql
again, I get this error message although my password is correct surely.

ERROR 1251: Client does not support authentication protocol requested by
server; consider upgrading MySQL client

????

I think you need to download the mysql-clients package. You seem to be
using a client from a 4.0 package. The password encryption has changed.
Mike A.

MySQL 5.0.15 on FreeBSD 5.4
Nov 29 '05 #9
AnhTai wrote:
I have read that page and understood how to set password for users.
However, I can't login into mysql console admin via the command:

# mysql -h atlantis -u root -p mysql
password: <my password>

Although I typed my password correctly, i got the error message:

ERROR 1251: Client does not support authentication protocol requested
by server; consider upgrading MySQL client


I see you're specifying the host using the -h flag. Is there a chance
you're running this command on a machine installed with an older version
of MySQL (4.0 or earlier) and that this old client does not support the
authentication protocol requested by the server?

Have you read this page:
http://dev.mysql.com/doc/refman/5.0/en/old-client.html

Can you connect to a database running the command-line tool on the
"atlantis" server? What version of MySQL client is installed there?

Have you tried running the MySQL 5.0 server with the --old-passwords
option, as suggested in that page? You'll have to do this anyway, if
you want to use PHP.

Regards,
Bill K.
Nov 29 '05 #10
Thanks Mike and Bill,

Some info about "my lab". I have only one Sun box, running Solaris 10
and installed package mysql5 from blastwave.org.

I connect to mysql directly from command line prompt at Sun box. When
the password of root isn't set, i can connect easily but after I set
password for root account, reboot the server, i get the ERROR 1251 when
I try to connect again.

I see in your replies, possibly, my mysql client is too old and need to
be upgraded. I will install mysqlclient5 from blastwave.org, hope that
"fix" my problem.

Thanks all again.

Nov 29 '05 #11
On Tue, 29 Nov 2005 08:08:30 -0800, AnhTai wrote:
Thanks Mike and Bill,

Some info about "my lab". I have only one Sun box, running Solaris 10
and installed package mysql5 from blastwave.org.

I connect to mysql directly from command line prompt at Sun box. When
the password of root isn't set, i can connect easily but after I set
password for root account, reboot the server, i get the ERROR 1251 when
I try to connect again.

I see in your replies, possibly, my mysql client is too old and need to
be upgraded. I will install mysqlclient5 from blastwave.org, hope that
"fix" my problem.

Thanks all again.


There are Solaris (Sparc 32/64 bit and intel 32/64 bit) binaries
available on the MySQL site:
http://dev.mysql.com/downloads/mysql/5.0.html
Nov 30 '05 #12

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

Similar topics

4
by: Brett B | last post by:
Folk, I have mysql installed via rpm package, but when I check the data dirs, the only table there is "test". The instructions say there should be others, like users tables, and other such...
0
by: DLacey | last post by:
I have a .NET C# application that uses the indexing service. It adds folders to the catalog to be indexed, removes them, etc. Currently the application requires the user be an admin user in order...
0
by: nemo | last post by:
Hi, I'm able to create, debug, and run ASP.Net projects when I login as a user with admin privileges. However if I logon to the same machine as a user without admin privileges, I get the...
0
by: Rahul Babbar | last post by:
Hi, I have two users, both of which are part of db2grp1, which is the admin user. db2grp1 has atleast 2 users, user1 and user2. I create a table in user2, name it table2. When i try to delete...
0
by: =?Utf-8?B?amFja3Y=?= | last post by:
we tried to run our system under a non-admin user to prevent clients from installing programs. We found out we could not correct the system time from our program when we do that. Is there a way to...
2
by: gangac | last post by:
I am currently working on an ms access application for a large insurance company which generates reports for the user after the user inputs/select some data.... Unfortunately the application has...
0
by: Big Charles | last post by:
Hello, Programming in VS2003-ASP.NET 1.1, I have this problem: Using DirectoryEntry and without any admin user, how can I check if a domain account, that try to login, has expired? Scenario: User...
2
by: Scott | last post by:
Attempting to install WCF service on stand alone 2003 server as a admin user (not administrator but user "WCF" i.e user added to local admin group). It fails with user error: The description...
1
by: Babu1983 | last post by:
Hi I had accidentally deleted the sole Admin user for my db. ie. My db had a single admin user 'kanagab'. somehow, I had deleted the user 'kanagab' (Tools->Security->User and Group...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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
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,...

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.