If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Create user password problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-24-06, 10:44
satimis satimis is offline
Registered User
 
Join Date: Jun 2006
Posts: 56
Create user password problem

Hi folks,

Ubuntu-6.06.1-LAMP-server-amd64
MySQL Ver 14.12 Distrib 5.0.22, for pc-linux-gnu (x86_64) using readline 5.1.

Encountered problem on creating user password. Steps performed as follows;

$ mysql -u root -p
Enter password:
Code:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 11 to server version: 5.0.22-Debian_0ubuntu6.06.2-lo g

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> creat user 'satimis'@'localhost' password satimispassword;
Code:
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 'creat user 'satimis'@'localhost' password 
satimissql' at line 1
Looking at "13.5.1.1. CREATE USER Syntax"
http://www.mysql.org/doc/refman/5.0/en/create-user.html

I can't resolve the correct syntax. Please advise. TIA


B.R.
satimis
Reply With Quote
  #2 (permalink)  
Old 11-24-06, 11:13
healdem healdem is online now
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,259
i'd try
create user 'satimis'@'localhost' identified by 'satimispassword';

its a heck of a lot easier to do this using MySQL Administrator though

you also need to GRANT permissions to this user to databases & databases objects.
And then FLUSH Privileges to ensure that MySQL relaods the privileges.
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #3 (permalink)  
Old 11-24-06, 11:26
satimis satimis is offline
Registered User
 
Join Date: Jun 2006
Posts: 56
Hi healdem,

Tks for your advice.

I got it done.

mysql> create user 'satimis'@'localhost' identified by 'satimispassword';
Code:
Query OK, 0 rows affected (0.03 sec)

mysql>
Quote:
its a heck of a lot easier to do this using MySQL Administrator though
I do agree with you. I'm trying to learn the basic.

Quote:
you also need to GRANT permissions to this user to databases & databases objects.
And then FLUSH Privileges to ensure that MySQL relaods the privileges.
Would this section relevant?

13.5.1.3. GRANT Syntax
http://www.mysql.org/doc/refman/5.0/en/grant.html

TIA


B.R.
satimis
Reply With Quote
  #4 (permalink)  
Old 11-24-06, 11:42
healdem healdem is online now
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,259
...yes

for a development server, especially when you are just starting out using MySQL then Id suggest you use...
GRANT ALL ON *.* TO <userid> IDENTIFIED BY '<yourpasword>'

however it is suggested only whne you first start out, when it can be a bit intimidating to get a server awake. Once you are happy you have the server workign, and up to speed with the MYSQL security model then you should dedcide what your security policies are, and how you want to apply those policies in MySQL. As a geenral rule a user should only have access to the do thes tasks they need to, on the objects they need to on the dataabases they use, apart formt hat they should have no other access. One thing that I think missing in MySQL security is the concept of Roles... it may now be introduced in V5, but it hasn't when I Last looked at mySQL security
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #5 (permalink)  
Old 11-25-06, 01:57
satimis satimis is offline
Registered User
 
Join Date: Jun 2006
Posts: 56
Hi healdem,

Quote:
for a development server, especially when you are just starting out using MySQL then Id suggest you use...
GRANT ALL ON *.* TO <userid> IDENTIFIED BY '<yourpasword>'
$ mysql -u root -p
Enter password:
Code:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 15 to server version: 5.0.22-Debian_0ubuntu6.06.2-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> grant all on *.* to satimis@localhost identified by 'rootpassword';
Code:
Query OK, 0 rows affected (0.01 sec)
I got it done. Tks.

I spent a while to find out <userid>. I though it was "satimis" only.

But still having problem;

$ sudo /etc/init.d/mysql restart
Password:
Code:
Stopping MySQL database server: mysqld...failed.
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'
Killing MySQL database server by signal: mysqld.
Starting MySQL database server: mysqld.
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'
satimis@ubuntu:~$ /usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'
(it was hanging here)
Waiting for input or NOT working? Pressing [Enter] prompted "satimis@ubuntu:~$"

Please advise how to fix the problem. What is
Code:
error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'
TIA

Others noted with tks.


B.R.
satimis
Reply With Quote
  #6 (permalink)  
Old 11-25-06, 04:45
healdem healdem is online now
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,259
what do you think this error message means
"error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'"


...think about it


...what is it actually saying


...could it be informing you of the problem its experiencing


...if so it may be telling you explicitly that its expecting to find a user called "debian-sys-maint" from host "localhost" with specific privileges. So you need to find if that user id & host exists... again MySQL Administrator makes these sort of tasks far easier..... If you are struggling to use the command line version then use it.

apparently "debian-sys-maint" is a special userid used on debian systems to do syste tasks, and is called to shutdown MySQL. but then if you'd googled that you would already know. Its specific to debiuan Linux, and therefore outside the scope of this forum.
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
Pingbacks are On
Refbacks are On