LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Trouble Logging in to mysql (https://www.linuxquestions.org/questions/linux-newbie-8/trouble-logging-in-to-mysql-187769/)

tommytomato 06-04-2004 03:14 AM

This is some of my notes i keep, does it help ? ( Fedora Core 1 notes mysql setup )

Code:

[root@localhost root]# /usr/bin/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
031120  1:01:10  /usr/libexec/mysqld: Shutdown Complete


To start mysqld at boot time you have to copy support-files/mysql.server
to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
This is done with:
/usr/bin/mysqladmin -u root  password 'new-password'
/usr/bin/mysqladmin -u root -h localhost  password 'new-password'
See the manual for more instructions.

You can start the MySQL daemon with:
cd /usr ; /usr/bin/safe_mysqld &

You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
cd sql-bench ; run-all-tests

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@localhost root]#


starting mysql

[root@localhost root]# /etc/rc.d/init.d/mysqld start
Starting MySQL:                                            [  OK  ]
[root@localhost root]#

Test MySQL now
[root@localhost root]# /usr/bin/mysql -u root -p >> < enter password when asked >
show databases;
it should show you the databases. [ mysql ] and [ test ]

[root@localhost bin]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 13 to server version: 3.23.58

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show databases;
+----------+
| Database |
+----------+
| mysql    |
| test    |
+----------+
2 rows in set (0.01 sec)

mysql>

TT

smokylux 06-04-2004 03:15 AM

Remember to edit the conf file of phpmyadmin so that it fits your needs.

also remember that, with phpmyadmin, in the DB "mysql", you must use the option "password" for the password field, when you set it for root user.
(Used md5 which didn't work, got the same problems after that)

As I had this probleem too, mysqld was running several times at once, so I had to stop all of them, before restarting it.


On Mysql.com there is a tutorial on how to reset the root password, by the way....


this might help a little... hope so! ;)



smokylux

lamedavis 06-04-2004 03:19 AM

yeah I have tried that too....regardless if I set the password from mysql on the command line or in phpmyadmin, the mysqld wont start. If I remove the password then it starts fine...

any other ideas?

Jeremy

tommytomato 06-04-2004 03:23 AM

have you tried the mysql config file
I remember seeing you could add the root password , port etc etc

cant remember where try looking under /etc

TT

lamedavis 06-04-2004 03:30 AM

there is a my.cnf file in /etc that is for mysql it shows the user as mysql so would I add a line under that with the password?

tommytomato 06-04-2004 03:33 AM

I dont think so.

I cant seem to be able to find the file i was talking about, but i am looking for it. I've used a few different OS over the past week,

TT

tommytomato 06-04-2004 03:39 AM

try looking at this file, just trying to help out

/usr/bin/mysql_config


TT

lamedavis 06-04-2004 03:44 AM

Well that doesnt seem to help....


I must be doing something wrong here....I dont understand the fact that the server will start and say OK when there is no password...but if there is i will do /etc/init.d/mysqld start and it says FAILED

Any other Ideas?

Jeremy

tommytomato 06-04-2004 03:49 AM

try looking in your services turn it on

try this command should show you a list ( ntsysv )

or chkconfig mysqld on

/etc/init.d/mysqld start

/etc/init.d/mysqld status


any help ?

TT

smokylux 06-04-2004 03:53 AM

try: ps -aux

to see if you got mysqld running more than once... I remember having that problem when dealing with that root password.

just kill all the processes and start mysqld again (only once of course)

just an idea, btw ;)


smokylux

lamedavis 06-04-2004 12:32 PM

yeah its only running once......it funny that when I do /etc/init.d/mysqld restart it will tell me that it shut down ok, but it will say failed on the start end....but when in fact it still starts. Whats that about?

Jeremy

daemonspyre 06-04-2004 02:21 PM

OK. Now that you all have confused him, now it's time for a MySQL administrator to come in... =D

Now that you have installed MySQL, you can start the system by running

shell> /usr/local/mysql/bin/mysqld_safe &

THEN you can change the password using mysqladmin

[shell mysql]> mysqladmin -u root password 'new-password'

NOW you can log into mysql with the password option

[shell mysql] > mysql - u root -p
Password: 'new-password'

Let me know if you are still having troubles after that. I will keep checking back here every so often.

lamedavis 06-04-2004 05:57 PM

I dont have a problem loggin into mysql from mysql -u r oot -p
the problem that I have is when I try /etc/init.d/mysqld start it pauses for about 10 seconds and then says failed. but what peculiar about it is it must be running because my website works that I am working on...its phpnuke web portal with mysql database. so what I am really asking is why does it say failed when I start the server when it seems to be running?

thanks for helpin me out,

Jeremy

daemonspyre 06-05-2004 01:36 AM

It depends on how you are trying to start it. If you are using InnoDB, you would get an error message if your config is wrong. Look in the /mysql/data directory at the 'hostname'.err file. That will tell you why it is failing. Secondly, don't try to run it from etc/init.d unless you are wanting it to start at boot. You should only start the server from the /mysql/bin folder. If you want to start the mysql server from boot, let me know and I will post the instructions to do so.

lamedavis 06-05-2004 01:57 AM

ok I cant find a 'hostname'.err file but here is the log for mysql

040604 23:39:39 mysqld started
Cannot initialize InnoDB as 'innodb_data_file_path' is not set.
If you do not want to use transactional InnoDB tables, add a line
skip-innodb
to the [mysqld] section of init parameters in your my.cnf
or my.ini. If you want to use InnoDB tables, add to the [mysqld]
section, for example,
innodb_data_file_path = ibdata1:10M:autoextend
But to get good performance you should adjust for your hardware
the InnoDB startup options listed in section 2 at
http://www.innodb.com/ibman.html
/usr/libexec/mysqld: ready for connections

it refers to the innodb like you mentioned.....so what do I do from here?

thanks again for you help bro,

Jeremy


All times are GMT -5. The time now is 05:48 AM.