Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

using mysql on fedora 6

Posted on 2006-11-11
12
Medium Priority
?
240 Views
Last Modified: 2013-12-06
I've imported a database from another server it loaded up fine. Now I've added a user and am trying to run a php file the php file says cannot connect to database. Using the same login as specified in the php file I'm able to connect to mysql admintrator. The php file is on the localhost as is the sql server. Perissions have been set to allow the localhost to connect. Want to run down a list of reasons I may be not able to connect to the DB? I know my php code is correct as it can connect to my old server.
0
Comment
Question by:JPERKS1985
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
  • 3
12 Comments
 
LVL 14

Expert Comment

by:ygoutham
ID: 17927980
is selinux running?  if so then it might create permission issues if not configured properly.

setenforce 0

the above command will disable selinux and try testing the code once again.
0
 
LVL 1

Author Comment

by:JPERKS1985
ID: 17928294
i tried that, still can't get it to work.
0
 
LVL 14

Expert Comment

by:ygoutham
ID: 17928559
0is the user added in mysql table with proper rights??

is the user added with the ip address of the machine rather than localhost????
0
Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

 
LVL 5

Expert Comment

by:ircpamanager
ID: 17929692
sounds like ygoutham is correct, you can check to see if that is the problem by typing:\
GRANT ALL PRIVILEGES ON *.* TO 'you'@'%'
    ->     IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
this will give "you" access to all from any host. Make sure you delete this user after you are done.
0
 
LVL 1

Author Comment

by:JPERKS1985
ID: 17932168
i'm using the gui mysql admin, for the user all the resource limits are set at 0 which is infinite I take it, the user was granted access to the proper database yet it still won't connect.
0
 
LVL 5

Expert Comment

by:ircpamanager
ID: 17932320
try doing it from cli.
mysql -u user -p password
GRANT ALL PRIVILEGES ON *.* TO 'you'@'%'
    ->     IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
0
 
LVL 1

Author Comment

by:JPERKS1985
ID: 17934491
[root@ip-207-145-62-4 ~]# mysql -u imgsrv -p imgsrv
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 22 to server version: 5.0.22

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

mysql>
0
 
LVL 1

Author Comment

by:JPERKS1985
ID: 17934504
ERROR 1045 (28000): Access denied for user 'imgsrv'@'localhost' (using password: YES)
0
 
LVL 1

Author Comment

by:JPERKS1985
ID: 17934569
second tried I logged in as root and did it


mysql> GRANT ALL PRIVILEGES ON *.* TO 'imgsrv'@'%'
    -> IDENTIFIED BY '*****' WITH GRANT OPTION;
Query OK, 0 rows affected (0.02 sec)

mysql>


I am not unsuccessful at connecting to the database.
0
 
LVL 1

Author Comment

by:JPERKS1985
ID: 17934573
sorry i meant to say I am still unsuccesful.
0
 
LVL 14

Accepted Solution

by:
ygoutham earned 2000 total points
ID: 17936361
what does

connect to

mysql mysql

select * from user

and

select * from table_priv

does this have imgsrv?  see through the info.  these tables must have the user details and his rights list in them for the user to be able to connect.
0
 
LVL 5

Expert Comment

by:ircpamanager
ID: 17939788
is the DB on the same server as Apache
0

Featured Post

Interactive Way of Training for the AWS CSA Exam

An interactive way of learning that will help you visualize core concepts so that you can be more effective when taking your AWS certification exam.  Built for students by a student to help them understand the concepts that they are being taught.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You ever wonder how to backup Linux system files just like Windows System Restore?  Well you can use Timeshift in Linux to perform those similar action.  This tutorial will show you how to backup your system files and keep regular intervals. Note…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question