Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
mysql help
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
scap1784
Apprentice
Apprentice


Joined: 25 Dec 2002
Posts: 225

PostPosted: Tue Jun 17, 2003 9:03 pm    Post subject: mysql help Reply with quote

i just installed mysql and i have never used it before i am trying to set the root password so i can use phpmyadmin however i am having difficulty.

Code:

root@scaparra scap # mysqladmin -u root password 'password'
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
root@scaparra scap # /etc/init.d/mysql start
 * Starting mysqld...                                                     [ ok ]root@scaparra scap # mysqladmin -u root password 'password'
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: 'root@localhost' (Using password: NO)'
root@scaparra scap #



What am i doing wrong
Back to top
View user's profile Send private message
Highlands
Guru
Guru


Joined: 22 Apr 2003
Posts: 366
Location: Sundsvall, Sweden

PostPosted: Tue Jun 17, 2003 9:20 pm    Post subject: Reply with quote

test
Code:

mysql

if it doesn't work try
Code:

mysql -p 'password'

_________________
If Windows is the answer, you don't understand the question!
http://counter.li.org/cgi-bin/certificate.cgi/339446
Back to top
View user's profile Send private message
scap1784
Apprentice
Apprentice


Joined: 25 Dec 2002
Posts: 225

PostPosted: Wed Jun 18, 2003 1:22 am    Post subject: Reply with quote

Code:

root@scaparra scap # mysql -p 'password'
Enter password:
ERROR 1049: Unknown database 'password'
Back to top
View user's profile Send private message
xedx
Tux's lil' helper
Tux's lil' helper


Joined: 23 May 2003
Posts: 93

PostPosted: Wed Jun 18, 2003 2:39 am    Post subject: Reply with quote

did you already do
Code:
/usr/bin/mysql_install_db

_________________
--+//+
Back to top
View user's profile Send private message
Iron_Mike
Tux's lil' helper
Tux's lil' helper


Joined: 21 Jan 2003
Posts: 83

PostPosted: Wed Jun 18, 2003 2:53 am    Post subject: Reply with quote

i have the same problem as the above, having already ran /usr/bin/mysql_install_db
I still get the error:

Code:

Enter password:
ERROR 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)



sorry to break in
Back to top
View user's profile Send private message
slartibartfasz
Veteran
Veteran


Joined: 29 Oct 2002
Posts: 1462
Location: Vienna, Austria

PostPosted: Wed Jun 18, 2003 4:05 am    Post subject: Reply with quote

@scap

Code:

mysql -u root


if u get to the mysql shell set the password:

Code:

mysql> use mysql;
mysql> SET PASSWORD FOR root@localhost=PASSWORD('new_password');


if this does not work, go to the mysql.com homepage and take look at the instructions for resetting the root password...

@Iron_Mike

sorry if this is too obvious (but hey u never know) - did u start the server?

Quote:

/etc/init.d/mysql start


if yes, take a look at the sockets - perhaps there is a dead one left over from a crash. if this is also not the case, check permissions on /var/run/mysql - has to be writeable by mysql...
_________________
To an engineer the glass is neither half full, nor half empty - it is just twice as big as it needs to be.
Back to top
View user's profile Send private message
scap1784
Apprentice
Apprentice


Joined: 25 Dec 2002
Posts: 225

PostPosted: Wed Jun 18, 2003 9:54 am    Post subject: Reply with quote

yea i did start the server and noo i can't get into the shell because for some reason it has a password and i never set one as for installdb this is what it prints...

Code:

root@scaparra scap # mysql_install_db
Installing all prepared tables
030618  5:47:32  /usr/sbin/mysqld: Shutdown Complete
 
 
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
This is done with:
/etc/init.d/mysql start  (you have to start the server first!)
/usr/bin/mysqladmin -u root  password 'new-password'
/usr/bin/mysqladmin -u root -h scaparra.com  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!
 
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
 


however i get the same problems as above after doing that
Back to top
View user's profile Send private message
Iron_Mike
Tux's lil' helper
Tux's lil' helper


Joined: 21 Jan 2003
Posts: 83

PostPosted: Wed Jun 18, 2003 6:17 pm    Post subject: Reply with quote

@slart

the place where the sockets is suppose to be is empty
(if only i knew what a socket is :) )

yes it is started...it starts correctly (with the green [ok]) and all but when i try things with mysqladmin <whatever option> then the message appears
and /var/run/mysqld (wich is empty)
drwxr-xr-x 2 mysql mysql 48 Jun 17 19:53 mysqld

any other ideas?


Last edited by Iron_Mike on Wed Jun 18, 2003 7:00 pm; edited 1 time in total
Back to top
View user's profile Send private message
Iron_Mike
Tux's lil' helper
Tux's lil' helper


Joined: 21 Jan 2003
Posts: 83

PostPosted: Wed Jun 18, 2003 6:57 pm    Post subject: Reply with quote

ok, what i have found is that i should have a file mysql.sock in /var/lib/mysql...

its nowhere to be found on my system...c!!!
Back to top
View user's profile Send private message
slartibartfasz
Veteran
Veteran


Joined: 29 Oct 2002
Posts: 1462
Location: Vienna, Austria

PostPosted: Wed Jun 18, 2003 7:27 pm    Post subject: Reply with quote

ok - maybe this helps:

Robin Johnson wrote:

It works here for me, with one minor change.
1. ebuild /var/db/pkg/dev-db/mysql*/*.ebuild config
2. mysqladmin -u root -h darkstar password 'new-password'
then the next instruction says:
mysqladmin -u root -h darkstar password 'new-password'
but I found I had to:
mysqladmin -u root -h darkstar -p password 'new-password'
and when prompted, enter the new-password from instruction 2.

One other thing for you to check, is if you have a pre-existing MySQL database in
/var/lib/mysql.
In that case, the config does NOT overwrite it, and the old password is still in
place.


replace 'darkstar' with your hostname [OT: great film btw - i mean darkstar :P]
_________________
To an engineer the glass is neither half full, nor half empty - it is just twice as big as it needs to be.
Back to top
View user's profile Send private message
Iron_Mike
Tux's lil' helper
Tux's lil' helper


Joined: 21 Jan 2003
Posts: 83

PostPosted: Wed Jun 18, 2003 8:20 pm    Post subject: Reply with quote

yup

when starting mysql without giving a hostname in parameter, results in mysql trying to connect thru the sockets, wich doesnt exist on my server

but if i go

mysql -h hostname

it works...
i guess what you wrote in your other reply is to make mysql look for hostname by default

other problem, i cant make the regular users able to create or modify table other than the test one...

only root can achieve it, how can i make it that all my users can create their own table
Back to top
View user's profile Send private message
scap1784
Apprentice
Apprentice


Joined: 25 Dec 2002
Posts: 225

PostPosted: Wed Jun 18, 2003 10:20 pm    Post subject: Reply with quote

This is prolly a retarded question but i am starting all over cause i think i really screwed this up but are you suposed to do this first:

Code:

/usr/bin/mysql_install_db
Back to top
View user's profile Send private message
scap1784
Apprentice
Apprentice


Joined: 25 Dec 2002
Posts: 225

PostPosted: Wed Jun 18, 2003 10:48 pm    Post subject: Reply with quote

ok i think i got it but i don't really understand if i set a password or not is my password "new-password" for the root user?? also just typeing mysql in a terminal brings up the monitor now.

Code:

root@scaparra mysql # mysql_install_db
Preparing db table
Preparing host table
Preparing user table
Preparing func table
Preparing tables_priv table
Preparing columns_priv table
Installing all prepared tables
030618 18:39:55  /usr/sbin/mysqld: Shutdown Complete
 
 
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
This is done with:
/etc/init.d/mysql start  (you have to start the server first!)
/usr/bin/mysqladmin -u root  password 'new-password'
/usr/bin/mysqladmin -u root -h scaparra.com  password 'new-password'
See the manual for more instructions.
 
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
 
root@scaparra mysql # /etc/init.d/m
metalog  modules  mysql
root@scaparra mysql # /etc/init.d/mysql start
 * WARNING:  "mysql" has already been started.
root@scaparra mysql # /etc/init.d/mysql stop
 * Stopping mysqld...                                                     [ ok ]root@scaparra mysql # /etc/init.d/mysql start
 * Starting mysqld...                                                     [ ok ]root@scaparra mysql # mysqla
mysqlaccess   mysqladmin    mysqlanalyze
root@scaparra mysql # mysqladmin -u root -h scaparra.com password 'new-password'root@scaparra mysql #
Back to top
View user's profile Send private message
Iron_Mike
Tux's lil' helper
Tux's lil' helper


Joined: 21 Jan 2003
Posts: 83

PostPosted: Wed Jun 18, 2003 11:41 pm    Post subject: Reply with quote

anyone ever seen this:

cannot load MySQL extension,
please check PHP Configuration.
Documentation
Back to top
View user's profile Send private message
slartibartfasz
Veteran
Veteran


Joined: 29 Oct 2002
Posts: 1462
Location: Vienna, Austria

PostPosted: Thu Jun 19, 2003 7:42 am    Post subject: Reply with quote

scap1784 wrote:
ok i think i got it but i don't really understand if i set a password or not is my password "new-password" for the root user?? also just typeing mysql in a terminal brings up the monitor now.


i took a look at it - seems that mysql didnt accept the passwd. u can check this by:

Code:

mysql -u root
mysql> select mysql;
mysql> select * from user;


u wont see any passwords set...

u can set a password by hand:

Code:

mysql -u root
myslq> set password=password('type-your-password-here');

_________________
To an engineer the glass is neither half full, nor half empty - it is just twice as big as it needs to be.
Back to top
View user's profile Send private message
slartibartfasz
Veteran
Veteran


Joined: 29 Oct 2002
Posts: 1462
Location: Vienna, Austria

PostPosted: Thu Jun 19, 2003 7:43 am    Post subject: Reply with quote

Iron_Mike wrote:
anyone ever seen this:

cannot load MySQL extension,
please check PHP Configuration.
Documentation


when u do what?

[EDIT:] time for a new thread i think... (unless it is not covered elsewhere, there are a lot of threads about php+apache+mysql)
_________________
To an engineer the glass is neither half full, nor half empty - it is just twice as big as it needs to be.


Last edited by slartibartfasz on Thu Jun 19, 2003 10:50 am; edited 1 time in total
Back to top
View user's profile Send private message
Iron_Mike
Tux's lil' helper
Tux's lil' helper


Joined: 21 Jan 2003
Posts: 83

PostPosted: Thu Jun 19, 2003 9:41 am    Post subject: Reply with quote

when trying to acess a page using php AND mysql

they are both running fine seperately, but when use 2gether this is the result
Back to top
View user's profile Send private message
Senso
Apprentice
Apprentice


Joined: 17 Jun 2003
Posts: 250
Location: Montreal, Quebec

PostPosted: Thu Jun 19, 2003 12:52 pm    Post subject: Reply with quote

I had a similar problem with setting the root password a couple of months ago. If I remember correctly, I had to use the option '-u root@localhost' and not just '-u root'.
Might help someone else...
Back to top
View user's profile Send private message
scap1784
Apprentice
Apprentice


Joined: 25 Dec 2002
Posts: 225

PostPosted: Thu Jun 19, 2003 9:51 pm    Post subject: Reply with quote

ok well thanks alot for the help guy but i broke down and went and just bought a O'REILY mysql book. It has helped alot. finally got it up with the right permissions and settings etc...

Thanks
Scap
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum