View previous topic :: View next topic |
Author |
Message |
scap1784 Apprentice
Joined: 25 Dec 2002 Posts: 225
|
Posted: Tue Jun 17, 2003 9:03 pm Post subject: mysql help |
|
|
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 |
|
|
Highlands Guru
Joined: 22 Apr 2003 Posts: 366 Location: Sundsvall, Sweden
|
|
Back to top |
|
|
scap1784 Apprentice
Joined: 25 Dec 2002 Posts: 225
|
Posted: Wed Jun 18, 2003 1:22 am Post subject: |
|
|
Code: |
root@scaparra scap # mysql -p 'password'
Enter password:
ERROR 1049: Unknown database 'password'
|
|
|
Back to top |
|
|
xedx Tux's lil' helper
Joined: 23 May 2003 Posts: 93
|
Posted: Wed Jun 18, 2003 2:39 am Post subject: |
|
|
did you already do
Code: | /usr/bin/mysql_install_db |
_________________ --+//+ |
|
Back to top |
|
|
Iron_Mike Tux's lil' helper
Joined: 21 Jan 2003 Posts: 83
|
Posted: Wed Jun 18, 2003 2:53 am Post subject: |
|
|
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 |
|
|
slartibartfasz Veteran
Joined: 29 Oct 2002 Posts: 1462 Location: Vienna, Austria
|
Posted: Wed Jun 18, 2003 4:05 am Post subject: |
|
|
@scap
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 |
|
|
scap1784 Apprentice
Joined: 25 Dec 2002 Posts: 225
|
Posted: Wed Jun 18, 2003 9:54 am Post subject: |
|
|
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 |
|
|
Iron_Mike Tux's lil' helper
Joined: 21 Jan 2003 Posts: 83
|
Posted: Wed Jun 18, 2003 6:17 pm Post subject: |
|
|
@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 |
|
|
Iron_Mike Tux's lil' helper
Joined: 21 Jan 2003 Posts: 83
|
Posted: Wed Jun 18, 2003 6:57 pm Post subject: |
|
|
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 |
|
|
slartibartfasz Veteran
Joined: 29 Oct 2002 Posts: 1462 Location: Vienna, Austria
|
Posted: Wed Jun 18, 2003 7:27 pm Post subject: |
|
|
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 ] _________________ 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 |
|
|
Iron_Mike Tux's lil' helper
Joined: 21 Jan 2003 Posts: 83
|
Posted: Wed Jun 18, 2003 8:20 pm Post subject: |
|
|
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 |
|
|
scap1784 Apprentice
Joined: 25 Dec 2002 Posts: 225
|
Posted: Wed Jun 18, 2003 10:20 pm Post subject: |
|
|
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 |
|
|
scap1784 Apprentice
Joined: 25 Dec 2002 Posts: 225
|
Posted: Wed Jun 18, 2003 10:48 pm Post subject: |
|
|
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 |
|
|
Iron_Mike Tux's lil' helper
Joined: 21 Jan 2003 Posts: 83
|
Posted: Wed Jun 18, 2003 11:41 pm Post subject: |
|
|
anyone ever seen this:
cannot load MySQL extension,
please check PHP Configuration.
Documentation |
|
Back to top |
|
|
slartibartfasz Veteran
Joined: 29 Oct 2002 Posts: 1462 Location: Vienna, Austria
|
Posted: Thu Jun 19, 2003 7:42 am Post subject: |
|
|
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 |
|
|
slartibartfasz Veteran
Joined: 29 Oct 2002 Posts: 1462 Location: Vienna, Austria
|
Posted: Thu Jun 19, 2003 7:43 am Post subject: |
|
|
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 |
|
|
Iron_Mike Tux's lil' helper
Joined: 21 Jan 2003 Posts: 83
|
Posted: Thu Jun 19, 2003 9:41 am Post subject: |
|
|
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 |
|
|
Senso Apprentice
Joined: 17 Jun 2003 Posts: 250 Location: Montreal, Quebec
|
Posted: Thu Jun 19, 2003 12:52 pm Post subject: |
|
|
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 |
|
|
scap1784 Apprentice
Joined: 25 Dec 2002 Posts: 225
|
Posted: Thu Jun 19, 2003 9:51 pm Post subject: |
|
|
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 |
|
|
|