# MySQL...stuck at so many levels

## rodericj

This is prolly going to piss some people off. But maybe that will get me a link to my solution.

I am trying to run a whole bunch of things which require sql to be up and running. I am getting errors that indicate that my server is not running. So lets get started.

I want to use phpmyadmin:

so I go to www.mydomain.com/phpmyadmin and this is what happens:

```

Server localhost 

Error

MySQL said: 

#1045 - Access denied for user: 'pma@localhost' (Using password: YES) 

[Documentation]   <---this one is a link

```

Clicking the link brings me to a list of error messages and supposed explanations. 1045 states this...

```
Error: 1045 SQLSTATE: 28000 (ER_ACCESS_DENIED_ERROR) Message: Access denied for user '%s''%s' (using password: %s)

```

Not too helpfull...I am pretty convinced that I put in the correct password. Maybe I typed it in wrong. regardless, it won't let me enter the password again (both mozilla and opera). ideas?

step 2...lets get tikiwiki running:

www.mydomain.com/tiki....This gives me this error:

```
Warning: mysql_connect(): Access denied for user: 'root@localhost' (Using password: NO) in /var/www/localhost/htdocs/tikiwiki/lib/adodb/drivers/adodb-mysql.inc.php on line 318

Unable to login to the MySQL database 'tiki' on 'localhost' as user 'root'

Go here to begin the installation process, if you haven't done so already.

Access denied for user: 'root@localhost' (Using password: NO)
```

Fine...lets click the install link...I put in the appropriate information and I get this:

```
Tiki installer v1.8.2 (CVS) 

reload

Tiki cannot find a database connection

Please enter your database connection info

```

Ok...still can't find database connection: Anyone seeing a theme here?

These errors make me think that I am not running the sql daemon.

```
root@rodosan mysql # /etc/init.d/mysql status

 * status:  started

```

ok....I am stuck...

Can ANYONE point me in the right direction?

Thanks

----------

## kiezpro

First of all, you don't want to let your web applications access the database as root. Set up another user for each of them, with restricted permissions to allow them only what they have to be able to do. The documentation under /usr/share/doc/mysql-<version>/ will help you accomplish this.

Then, you either have the wrong password supplied - can you log in to the database using the shell, like

```
mysql -uroot -p 
```

, using the root password? Maybe you didn't supply one yet? If so, 

```
mysql -uroot
```

should work, and you should urgently set a password for the root user. 

If neither work and you get an error message that the mysql client can't connect over a socket to the server (I assume that it's running on the same machine), you can find out whether the server runs by entering

```
ps aux | grep mysql
```

in the shell.

----------

## rodericj

 *kiezpro wrote:*   

> ...
> 
> can you log in to the database using the shell, like
> 
> ```
> ...

 

I had a password which I was using for root...

This did work.

I am not sure what that tells me.

I am also able to log in as some of the dummy users I have made.These users do not work from the tikiwiki page.

I still can't access the DB's from the webapps.

So what is the next step?

----------

## kiezpro

Does the HTTP server run on the same machine as the MySQL database? If not, you need to create users for the http serving machine on the MySQL database server.

Or maybe you didn't allow the users you created to access the databases they need to use?

----------

## rodericj

HTTP server does run on the same machine.

I thought I gave them access to EVERYTHING. How would I go about giving them access?

I would assume just the command-line from mysql> would do it.

Hating this.

----------

