Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
 
Reply to this topicStart new topic
> Mysql Problem, trying to add user mail
Robert83
post May 15 2004, 03:45 PM
Post #1


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,439
Joined: 3-January 04
From: Germany
Member No.: 2,069



Hi,

when I do this
CODE
mysql> insert into
   -> user(host, user, password)
   -> values('localhost','mail',password('***********'));
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 'user(host, user, password)
values('localhost','mail',password('


what is wrong here?

Sincerely
Robert B


--------------------
Robert Becskei
robert83@linuxhelp.net
--------------------
May the source be with us!
--------------------
AMD X2-3800 @ 2400Mhz
2048MB DDR 400Mhz
DFI Lanparty UT4 NF4 ULTRA-D
GeForce 7800GT
250GB+250GB
Pioneer DVD-RW
17inch Samsung Syncmaster 757NF
WinXP Pro (SP2)/ CentOS 4.3
--------------------
Go to the top of the page
 
+Quote Post
hughesjr
post May 15 2004, 04:51 PM
Post #2


Its GNU/Linuxhelp.net
*******

Group: Admin
Posts: 3,433
Joined: 25-July 03
From: Corpus Chrsiti, TX, USA
Member No.: 1,151



You need a space between the user and the column names ... and between values and the data....like this:

insert into user (host,user,password) values ('localhost','mail',password('***********'));


--------------------
Johnny Hughes
hughesjr@linuxhelp.net
Enterprise Alternatives: CentOS, WhiteBoxEL
Favorite Workstation Distros (in order): CentOS, Gentoo, Debian Sarge, Ubuntu, Mandrake, FedoraCore, Slackware, SUSE
Favorite Server Distros (in order): CentOS, WhiteBoxEL, Debian Sarge, Slackware, Mandrake, FedoraCore, Gentoo, SUSE
Go to the top of the page
 
+Quote Post
Robert83
post May 15 2004, 06:50 PM
Post #3


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,439
Joined: 3-January 04
From: Germany
Member No.: 2,069



Hi,

I'm trying to add mail, it seems to add did those 2 steps first add the user, then that database user (my new mail user) stuff, and it still won't let mail@localhost in , it says Access denied for user : mail@localhost (Using password: YES)

what did I do wrong here? (tried it several times) ... is it a problem if I use the same code for mail as root ?

Sincerely
Robert B


--------------------
Robert Becskei
robert83@linuxhelp.net
--------------------
May the source be with us!
--------------------
AMD X2-3800 @ 2400Mhz
2048MB DDR 400Mhz
DFI Lanparty UT4 NF4 ULTRA-D
GeForce 7800GT
250GB+250GB
Pioneer DVD-RW
17inch Samsung Syncmaster 757NF
WinXP Pro (SP2)/ CentOS 4.3
--------------------
Go to the top of the page
 
+Quote Post
hughesjr
post May 16 2004, 06:55 AM
Post #4


Its GNU/Linuxhelp.net
*******

Group: Admin
Posts: 3,433
Joined: 25-July 03
From: Corpus Chrsiti, TX, USA
Member No.: 1,151



What guide are you using to install the postfix - mysql solution?

After all the programs are installed, you have to setup postfix properly ... usually in main.cf, transport.cf, vuids.cf, vgids.cf, aliases.cf, and remote_aliases.cf.


--------------------
Johnny Hughes
hughesjr@linuxhelp.net
Enterprise Alternatives: CentOS, WhiteBoxEL
Favorite Workstation Distros (in order): CentOS, Gentoo, Debian Sarge, Ubuntu, Mandrake, FedoraCore, Slackware, SUSE
Favorite Server Distros (in order): CentOS, WhiteBoxEL, Debian Sarge, Slackware, Mandrake, FedoraCore, Gentoo, SUSE
Go to the top of the page
 
+Quote Post
Robert83
post May 16 2004, 06:58 AM
Post #5


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,439
Joined: 3-January 04
From: Germany
Member No.: 2,069



Hi,

this guide http://www.delouw.ch/linux/Postfix-Cyrus-W...ml/install.html

it's at the botom of the page, creating databases and tables

if you can check it out please tell me , what does the author mean by this ?

After unpacking web-cyradm, move it to a place in your webserver's documentroot.


Thats all. Now you need to configure the whole bunch of software.


Web-cyradm 0.5.4 is considered stable, and was released on 2003-12-05


Since web-cyradm uses PEAR for its database abstraction layer, you also need a recent copy of PEAR. This is included in recent PHP Versions. I strongly suggest to update PHP to 4.3.4, because a lot of important bugs have been fixed.


A frequent mistake is to forget to touch the logfile and change the owner to the Apache UID. This is usually nobody or wwwrun.

Sincerely
Robert B


--------------------
Robert Becskei
robert83@linuxhelp.net
--------------------
May the source be with us!
--------------------
AMD X2-3800 @ 2400Mhz
2048MB DDR 400Mhz
DFI Lanparty UT4 NF4 ULTRA-D
GeForce 7800GT
250GB+250GB
Pioneer DVD-RW
17inch Samsung Syncmaster 757NF
WinXP Pro (SP2)/ CentOS 4.3
--------------------
Go to the top of the page
 
+Quote Post
Robert83
post May 16 2004, 07:40 AM
Post #6


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,439
Joined: 3-January 04
From: Germany
Member No.: 2,069



Hi,

can you please tell me what is wrong with my mysql settings,

first I created root, and created the database (skipped that user, and non localhost part).

and after that I did everything ( skipped root , non localhost), I added mail


what can be wrong?

Sincerely
Robert B


--------------------
Robert Becskei
robert83@linuxhelp.net
--------------------
May the source be with us!
--------------------
AMD X2-3800 @ 2400Mhz
2048MB DDR 400Mhz
DFI Lanparty UT4 NF4 ULTRA-D
GeForce 7800GT
250GB+250GB
Pioneer DVD-RW
17inch Samsung Syncmaster 757NF
WinXP Pro (SP2)/ CentOS 4.3
--------------------
Go to the top of the page
 
+Quote Post
hughesjr
post May 16 2004, 08:11 AM
Post #7


Its GNU/Linuxhelp.net
*******

Group: Admin
Posts: 3,433
Joined: 25-July 03
From: Corpus Chrsiti, TX, USA
Member No.: 1,151



Are you doing this on a WhiteBox machine?

I will try (today) to get a postfix install via the above guide on Whitebox EL. If I use a different guide, I will at least try to have all the functionality (SMTP, POP3, WEB Access, SASL) that is included in that guide ... BUT, I will try to use WhiteBox RPMS as much as possible (so MySQL will be 3.23.58, postfix will be 2.0.11-4 .... if possible.)

I will keep notes and try to post a guide ...


--------------------
Johnny Hughes
hughesjr@linuxhelp.net
Enterprise Alternatives: CentOS, WhiteBoxEL
Favorite Workstation Distros (in order): CentOS, Gentoo, Debian Sarge, Ubuntu, Mandrake, FedoraCore, Slackware, SUSE
Favorite Server Distros (in order): CentOS, WhiteBoxEL, Debian Sarge, Slackware, Mandrake, FedoraCore, Gentoo, SUSE
Go to the top of the page
 
+Quote Post
Robert83
post May 16 2004, 08:40 AM
Post #8


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,439
Joined: 3-January 04
From: Germany
Member No.: 2,069



Hi,

yes I'm doing this on a Whitebox machine,

but Johnny, if it's not to much to ask could you tell me why is mysql doing this with a mail account that I already added ?, how do I reset mysql to factory default, so that I can do everything (the mysql adding users and stuff) again?

Sincerely
Robert B


--------------------
Robert Becskei
robert83@linuxhelp.net
--------------------
May the source be with us!
--------------------
AMD X2-3800 @ 2400Mhz
2048MB DDR 400Mhz
DFI Lanparty UT4 NF4 ULTRA-D
GeForce 7800GT
250GB+250GB
Pioneer DVD-RW
17inch Samsung Syncmaster 757NF
WinXP Pro (SP2)/ CentOS 4.3
--------------------
Go to the top of the page
 
+Quote Post
Robert83
post May 16 2004, 09:45 AM
Post #9


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,439
Joined: 3-January 04
From: Germany
Member No.: 2,069



Hi,

I managed to do it,

first

use mysql
DELETE FROM user WHERE User='mail';

then I added the user again as show at GUIDES section of this forum

and did a

FLUSH PRIVILEGES

now it's working, oh... and I think to help people from ever screwing up the system so bad as me...tell them

NEVER EVER USE THE SAME PASSWORD FOR root and mail(regular user)

and also delete
DELETE FROM user WHERE User='';

why?

because of this :

The gist is that user@host matching is done host first, then user. If
more than one host matches, the most specific wins. So, when conecting as
roby from localhost, the anonymous user ''@localhost is a better match than
roby@%, because the host part is more specific. This bites a lot of people.
Most, I think, solve this by deleting the anonymous users.

mysql -u root -p mysql
mysql> DELETE FROM user WHERE User='';
mysql> FLUSH PRIVILEGES;

Sincerely
Robert B


--------------------
Robert Becskei
robert83@linuxhelp.net
--------------------
May the source be with us!
--------------------
AMD X2-3800 @ 2400Mhz
2048MB DDR 400Mhz
DFI Lanparty UT4 NF4 ULTRA-D
GeForce 7800GT
250GB+250GB
Pioneer DVD-RW
17inch Samsung Syncmaster 757NF
WinXP Pro (SP2)/ CentOS 4.3
--------------------
Go to the top of the page
 
+Quote Post
hughesjr
post May 16 2004, 09:54 AM
Post #10


Its GNU/Linuxhelp.net
*******

Group: Admin
Posts: 3,433
Joined: 25-July 03
From: Corpus Chrsiti, TX, USA
Member No.: 1,151



you should be able to add users to mysql ....

try running mysql like this (as root):

mysql -u root -p

It should prompt you for your root user's mysql password (or let you in if it is blank).

You then should be able to use the command (from within mysql):

show databases;

then do:

use mysql;

then do:

select user,host,password from user;

This should give you a list of all users who have mysql permissions....
----------------------EDIT----------------------
Never mind ... you already fixed it.... wink.gif

I was going to see if you had any users that needed deleting...


--------------------
Johnny Hughes
hughesjr@linuxhelp.net
Enterprise Alternatives: CentOS, WhiteBoxEL
Favorite Workstation Distros (in order): CentOS, Gentoo, Debian Sarge, Ubuntu, Mandrake, FedoraCore, Slackware, SUSE
Favorite Server Distros (in order): CentOS, WhiteBoxEL, Debian Sarge, Slackware, Mandrake, FedoraCore, Gentoo, SUSE
Go to the top of the page
 
+Quote Post
Robert83
post May 16 2004, 10:07 AM
Post #11


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,439
Joined: 3-January 04
From: Germany
Member No.: 2,069



Hi,

hit the wall again

$bindir/safe_mysqld --datadir=$datadir --pid-file=$pid_file
--bind-address=127.0.0.1&

do you know what the command is to make /etc/init.d/mysql.server start

default to 127.0.0.1 (localhost) , and not listen on the network ?

I wan't to add it to this file, so I won't have to type it in again manualy every time

the problem is that it's a newer version... cause it's not safe_mysqld, but it's mysqld_safe , and a few things are different, none of the options on this site, or on others (I have found till now) make mysql liston to localhost only.

please help

Sincerely
Robert B


--------------------
Robert Becskei
robert83@linuxhelp.net
--------------------
May the source be with us!
--------------------
AMD X2-3800 @ 2400Mhz
2048MB DDR 400Mhz
DFI Lanparty UT4 NF4 ULTRA-D
GeForce 7800GT
250GB+250GB
Pioneer DVD-RW
17inch Samsung Syncmaster 757NF
WinXP Pro (SP2)/ CentOS 4.3
--------------------
Go to the top of the page
 
+Quote Post
Robert83
post May 16 2004, 10:36 AM
Post #12


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,439
Joined: 3-January 04
From: Germany
Member No.: 2,069



Hi,

my fault....
all mine... don't look at me smile.gif

now it's working

just --bind-address="127.0.0.1"
and it should be put right after $bindir/mysqld_safe --bind-address="127.0.0.1" etc...etc...etc...

and now when I type netstat -an|grep LISTEN

tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN

Sincerely
Robert B


--------------------
Robert Becskei
robert83@linuxhelp.net
--------------------
May the source be with us!
--------------------
AMD X2-3800 @ 2400Mhz
2048MB DDR 400Mhz
DFI Lanparty UT4 NF4 ULTRA-D
GeForce 7800GT
250GB+250GB
Pioneer DVD-RW
17inch Samsung Syncmaster 757NF
WinXP Pro (SP2)/ CentOS 4.3
--------------------
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 14th December 2017 - 12:09 PM