LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-08-2003, 12:15 PM   #1
nocturnal
Member
 
Registered: Apr 2003
Location: Sweden
Distribution: Slackware, LFS
Posts: 80

Rep: Reputation: 15
Unhappy mysql just wont work


i've had this problem for 4 days now so please someone just point me in the right direction

i followed the instructions in a post here to get mysql working on slack 9 and i'm now using phpmyadmin to set user to root with all privs and no password and on localhost, and then there is this cms i'm trying to setup and it works just fine cuz i've used it before but this is the first time i'm doing it on my own box so i set it's config file to connect to localhost with root and no password and of course to the db name and before all this i've added the db intp phpmyadmin with success and now i flush user privs and i restart mysqld and it still wont work it simply shows nothing on the page that should be from the db it just shows the html and php code but not the db entries like news and it wont let me login(i'm using my old db from the last server) just like it doesn't even know that the db is there

could anyone please help me?
 
Old 07-08-2003, 12:21 PM   #2
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 68
From the sounds of your description:
Quote:
[snip]...shows nothing on the page that should be from the db it just shows the html and php code but not the db entries like news...[snip]
You either don't have Apache configured to use PHP, or you don't have PHP working correctly.

You might look at the respective sights, starting with www.php.net to make sure you've got those things setup correctly first.

Cool
 
Old 07-08-2003, 02:07 PM   #3
nocturnal
Member
 
Registered: Apr 2003
Location: Sweden
Distribution: Slackware, LFS
Posts: 80

Original Poster
Rep: Reputation: 15
the entire site is in php using echo to output html code it's the info that is in the db and which is also supposed to be output at certain places that is not being output, i know php works i ran tests.
 
Old 07-08-2003, 07:29 PM   #4
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 68
If you are seeing a screen that just looks like code (like if you choose to View Source on this page) then it's most likely something either:
1. Wrong with the PHP code itself;
2. Wrong with Apace interfacing with PHP;
3. Wrong with PHP's setup.

The DB part of the equation shouldn't even come into play yet, unless you aren't seeing code and I just read your initial inquiry wrong?



Cool
 
Old 07-08-2003, 08:03 PM   #5
nocturnal
Member
 
Registered: Apr 2003
Location: Sweden
Distribution: Slackware, LFS
Posts: 80

Original Poster
Rep: Reputation: 15
no no the php works fine...
the entire site is coded in php and it look just the way it's supposed to look but in those places that i know it's supposed to show data from the db thats where it shows nothing and i get no mysql errors
 
Old 07-09-2003, 01:58 AM   #6
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 68
Sounds good then, so let's tackle this MySQL thing then, which version are we going to be doing this on?

When you login to MySQL as root:
#mysql -u root -p
ROOTPASS
Where ROOTPASS is the mysql root user's password (not necessarily the same one from your system)
And display the databses:
mysql>show databases;
Does it list the database you created? If not, then there was a problem somewhere along those lines. Try retracing those steps to figure out where.

If it does list the database, did you give permissions to the user who will be grabbing info from it?

Cool
 
Old 07-09-2003, 05:34 AM   #7
nocturnal
Member
 
Registered: Apr 2003
Location: Sweden
Distribution: Slackware, LFS
Posts: 80

Original Poster
Rep: Reputation: 15
mysql> show databases;
+----------+
| Database |
+----------+
| fundb |
| mysql |
| test |
+----------+
3 rows in set (0.00 sec)

mysql>


the two db's that are there from install are there and fundb is the one i've created...
how do i create proper permissions for it?
just for future refference:
it's 3.23.56
slackware 9
the php works
i did mysql -u root -p and typed in a password and that sent me into mysql and let me do show databases;

thanks a lot for your help
 
Old 07-09-2003, 06:56 AM   #8
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 68
If it's possible, if you aren't using MySQL for anything else yet, I'd suggest upgrading to the latest 4.0.13 release; however there isn't really a problem with 'not' doing that, so no worries should you choose not to

On we go, permissions for users in mysql:

To create a user and to give them privileges in one full swoop (very nice feature I might add) you can use the GRANT option:
GRANT ALL PRIVILEGES ON fundb.* TO nocturnal@localhost IDENTIFIED BY 'a_password' WITH GRANT OPTION;

Be sure to follow each set of commands with a ; this tells mysql you are done and to then execute your request(s). To find out options to give to a user other than "ALL PRIVILEGES" see this page:
http://www.mysql.com/doc/en/GRANT.html

What the above syntax will do is create a user named "nocturnal" and give them access to any files in fundb, and it will create them with the password a_password The ' ' around 'a_password' should actually be included in the syntax.

At that point, if you give ALL PRIVILEGES to user nocturnal, then this user (with password since you also say identified by password) will have full access to that database and you can pass this information onto your application.

You should, for security, change that to only the necessary privileges necessary for your purposes, and you should also make sure that your user is extremely unprivileged with other databases should this one get comprimised. But for basic troubleshooting purposes, a user, will full privileges will be fine.



Cool
 
Old 07-09-2003, 09:26 AM   #9
nocturnal
Member
 
Registered: Apr 2003
Location: Sweden
Distribution: Slackware, LFS
Posts: 80

Original Poster
Rep: Reputation: 15
i did what you said and changed my site details and since i saw in the process list in phpmyadmin that fundb was not running i even did use fundb; in mysql so that it was in use but it still wont work...

thanks a lot for your help anyways
 
Old 07-09-2003, 09:33 AM   #10
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 68
Does fundb contain tables, or is it just an empty db shell? You will need to create tables in there usually as well, otherwise your applications have no idea on where to store things. Some (such as Postnuke) will make their own tables, so that's fine, but if your software doesn't then you will need to yourself. Read the softwares documentation to see if there is any mention of this.



Cool
 
Old 07-09-2003, 11:08 AM   #11
nocturnal
Member
 
Registered: Apr 2003
Location: Sweden
Distribution: Slackware, LFS
Posts: 80

Original Poster
Rep: Reputation: 15
there are tables i can see them through going to the db dir or through phpmyadmin since the db is simply a db i used on another server with the same cms and on this other server everything worked but i didn't set it up there and i just moved the whole thing to my box...

thanks a lot for your help but i wont waste your time anymore seems like i always get these weird problems that no one has answers to

thanks a lot for trying still
 
Old 07-09-2003, 07:44 PM   #12
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 68
You aren't wasting my time, that's what we are here for, to help suss out problems

Cool
 
Old 07-10-2003, 01:26 AM   #13
Manuel-H
Member
 
Registered: Apr 2003
Location: Singapore
Distribution: Slackware32/64, Ubuntu, Fedora, RHEL
Posts: 138

Rep: Reputation: 15
Check list

Just a checklist..

Make sure you have this php installed
/etc/apache/httpd.conf
Include /etc/apache/mod_php.conf

Make sure you run this program to create all the db
/usr/bin
mysql_install_db

chaneg the permission
/var/lib/mysql
chown -R mysql:mysql mysql

Test the apache
lynx localhost
or in windows via IE or Netscape
http://your local ip/

Test the PHP
have a test file called say test.php
inside this file put in
<? phpinfo(); ?>

Let me know which area do you have problem with.
 
Old 07-10-2003, 08:02 AM   #14
nocturnal
Member
 
Registered: Apr 2003
Location: Sweden
Distribution: Slackware, LFS
Posts: 80

Original Poster
Rep: Reputation: 15
apache -- CHECK!
php -- CHECK!
and i've also done all that with the mysql but i was wondering, does it affect things at all if i'm root or user when i'm doing all these things with mysql cuz some things like chown -R mysql:mysql mysql can't even be done without being root?
the thought hit me when i was doing locate after the db i wanna use with my user and it didn't find it and then i did locate with root and it found it of course so maybe thats it?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Php and Mysql wont play together Slith(++1) Mandriva 6 10-03-2005 09:53 PM
ok got fglrx 2d to work, now why wont 3d work? bvav22 Linux - Software 1 05-01-2005 06:25 PM
Domo and mysql wont talk linux_console Linux - Software 0 08-08-2004 09:50 PM
FALCONS EYE (nethack) FAILS ON STARTUP, use to work, wont work even after reinstall roorings Linux - Software 0 10-08-2003 10:39 PM
mysql wont stop Zac2003 Linux - Software 5 05-06-2003 11:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:18 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration