LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-21-2006, 03:18 AM   #1
mariogarcia
Member
 
Registered: Sep 2005
Distribution: debian, solaris 10
Posts: 202

Rep: Reputation: 31
compiled and installed mysql but i have problems


Hello,
i have downloaded mysql sources and installed them on debian sarge.
now i would like to start the server, and be able to create databases with it, in order to create a small forum and as i have to develop that forum from scratch;

how do i do to start the server? i know you can use something like bin/mysqld_safe, but i have errors related to localhost when i try to excute mysqladmin.
can someone show me how to start the server in order to store databases for my forum...
thank you very much for your help.
 
Old 08-21-2006, 03:54 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Did you read the INSTALL-SOURCE file that comes with the sources? Take a look at it for details, but in brief you should create the initial database that stores mysql users (running mysql_install_db) and then start the server. Quote from INSTALL-SOURCE:
Quote:
The basic commands that you must execute to install a MySQL source
distribution are:

shell> groupadd mysql
shell> useradd -g mysql mysql
shell> gunzip < mysql-VERSION.tar.gz | tar -xvf -
shell> cd mysql-VERSION
shell> ./configure --prefix=/usr/local/mysql
shell> make
shell> make install
shell> cp support-files/my-medium.cnf /etc/my.cnf
shell> cd /usr/local/mysql
shell> bin/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql var
shell> chgrp -R mysql .
shell> bin/mysqld_safe --user=mysql &
 
Old 08-21-2006, 02:46 PM   #3
mariogarcia
Member
 
Registered: Sep 2005
Distribution: debian, solaris 10
Posts: 202

Original Poster
Rep: Reputation: 31
I read everything on there and followed the instructions and i get the message 'Starting mysqld daemon with databases from /usr/local/mysql/var

then i try to do the following command
<shell>bin/mysqladmin version

and i get:
Code:
bin/mysqladmin:connect to server at 'localhost' failed
error:  'Access denied for user 'root'@'localhost'(using password: NO)'
i don't know what should be the next step? log in as mysql? what's the password? or i have to create a password for it using passwd mysql?
and what how do i set a hostname when i have to connect using php per instance, i must provide the hostname in the php function.
thank you

Last edited by mariogarcia; 08-21-2006 at 03:07 PM.
 
Old 08-22-2006, 12:55 AM   #4
mkirc
Member
 
Registered: Apr 2006
Location: Vienna-Austria
Distribution: Suse 10.x, Fedora, DSL
Posts: 63

Rep: Reputation: 15
Pls. check whether mysqld is running with ps -ef|grep mysql

If yes: Try the following:
/MYSQLHOME/bin/mysqladmin –u root password “new password”
/MYSQLHOME/bin/mysqladmin –u root –h “hostname” password “new password”

Now, user root should be allowed to connect to the mysql-server.

One more thing to consider:
Make sure that the mysql-server supports TCP-Sockets, I got a download package one, where only UNIX-Sockets were default configured, this leads to troubles as soon as you connect remotely !
 
Old 08-22-2006, 02:56 AM   #5
mariogarcia
Member
 
Registered: Sep 2005
Distribution: debian, solaris 10
Posts: 202

Original Poster
Rep: Reputation: 31
is there a way to erase all the configurations that have been done to mysql? and restart from scratch? I am sure at my first install i did some things not so clean. The most important thing for me is to be able to connect with php, for that what do i need? the name of the host? how do i get it.
the name of my computer is 'marioweb' and i can access it on my lan by http://marioweb/
by MYSQLHOME do you mean the directory i installed mysql, i have it at /usr/local/mysql/ as the manual suggested.
i also would like to add mysql to the path.. when i type at the shell mysql, it says command not found.
thank you very much.
 
Old 08-22-2006, 05:05 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
There is no need to erase the configuration, but if you insist delete (or better move somewhere else) the directory /usr/local/mysql/var/mysql which is the databse that stores users info etc.
Else you can stop mysqld and then restart it like this:
Code:
/usr/local/mysql/bin/mysqld  --skip-grant-tables -u root
This way it will not ask you for a password. Then connect to mysql server:
Code:
bin/mysql -u root
and either change the password for the mysql root user if you have already assigned one:
Code:
mysql> UPDATE mysql.user SET Password=PASSWORD('NEWPWD')  WHERE User='root';
mysql> FLUSH PRIVILEGES;
or set a password for root:
Code:
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('NEWPWD');
mysql> SET PASSWORD FOR 'root'@'HOST_NAME' = PASSWORD('NEWPWD');
mysql> FLUSH PRIVILEGES;
HOST_NAME is the name of your box.
If you want mysql to be in your PATH you should edit your ~/.bashrc or ~/.profile or whatever file your distro uses and add a line like this:
Code:
export PATH=$PATH:/usr/local/mysql/bin
 
Old 08-22-2006, 12:13 PM   #7
mariogarcia
Member
 
Registered: Sep 2005
Distribution: debian, solaris 10
Posts: 202

Original Poster
Rep: Reputation: 31
mysqld_safe is running, i kill it and it doesn't get killed. i think mysqld_safe isn't mysqld? the only way to make sure is to reboot the computer???
thank you very much for your help.
mario
ps mysqld and mysqld_safe are the same as my bin directory doesn't have a mysqld just a mysqld_safe
thank you

Last edited by mariogarcia; 08-22-2006 at 04:45 PM.
 
Old 08-23-2006, 02:03 AM   #8
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
ps mysqld and mysqld_safe are the same as my bin directory doesn't have a mysqld just a mysqld_safe
mysqld_safe is a shell script to run mysqld with some options. The daemon (mysqld) is located in /usr/local/mysql/libexec in your case. Note also that you can start/stop mysqld using
Code:
/usr/local/mysql/share/mysql/mysql.server start/stop
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
alsa driver compiled and installed... but no sound guitarfella Linux - Hardware 2 03-19-2005 10:12 AM
Searching compiled installed programs minm Linux - Newbie 2 09-14-2004 01:40 PM
Installed vs. Compiled Drivers, Which To Use? Brain2000 Linux - Newbie 1 06-14-2004 09:41 PM
Compiled en installed new Glib but Pango won't find it Haiyadragon Linux - Newbie 1 04-03-2004 08:08 AM
Installed/compiled 2.4.22 now unable to open modem jimdaworm Slackware 2 10-04-2003 11:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration