db.ini

I'm getting this error on the screen when I hit my omeka installation for the first time
Omeka Database Error

No such file or directory.

Confirm that the information in your db.ini file is correct.

the url is http://english3.fsu.edu/omeka

not sure what else you need, it's a lamp server php 5.3.7 I am using this .htaccess

# Remember to enable display_errors on development environments only.
<IfModule mod_php5.c>
php_value display_errors 1
php_flag register_globals off
</IfModule>

RewriteEngine on

# If know that mod_rewrite is enabled, but you are still getting mod_rewrite errors,
# uncomment the line below and replace "/" with your base directory.
RewriteBase /omeka

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^admin/ - [C]
RewriteRule .* admin/index.php [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* index.php

<FilesMatch "\.(php|ini)$">
Order Allow,Deny
Deny from all
</FilesMatch>

<Files index.php>
Allow from all
</Files>

# Uncomment the lines below in order to enable caching of some files via Apache (after a finished site has gone live)
<IfModule mod_expires.c>
# <FilesMatch "\.(js|ico|gif|jpg|png|css)$">
# ExpiresActive on
# ExpiresDefault "access plus 10 day"
# </FilesMatch>
</IfModule>

I'm hesitant to send the db.ini with the password but I think it's correct. I've used these settings successfully for a Wordpress installation
I gave the database user "all" privileges

thanks for your help

Right to be hesitant about putting passwords on a public forum!

My first guess, then, would be to double-check the name of the database you created for omeka, which will be a different database from your WordPress one. In some systems, a prefix is automatically added when you create a new database. So it might be worth double-checking whether there's a prefix as you look at the db.ini info.

It might also be worth double-checking whether the user that you have as all the permissions for the omeka database. Having all permissions for one database in mysql doesn't mean that you will automatically have permissions for new databases that you create.

To be a little more specific, the error "No such file or directory" when trying to connect to the database almost always means you're using "localhost" as your host in db.ini, but PHP isn't set up to look for the MySQL socket file in the right place.

The php.ini setting that controls this is mysqli.default_socket. It should be set to the same path that MySQL is set to use for the socket file.

Running the command

mysql --help | grep "^socket"

should output the correct socket path (assuming that the mysql command-line client is working).

in the db.ini file
I have the database name correct and the username and the password correct... triple checked.
I am using "localhost" as the host

my php.ini file had the following settings:

; Default socket name for local MySQL connects. If empty, uses the built-in
; MySQL defaults.
mysql.default_socket =

; Default socket name for local MySQL connects. If empty, uses the built-in
; MySQL defaults.
mysqli.default_socket =

I located the socket path using the command that you provided and it is /var/run/mysql/mysql.sock

so I changed the php.ini mysqli.default_socket as follows...
mysqli.default_socket = /var/run/mysql/mysql.sock

I'm still getting the same error... can you think of anything else?
thank you again

You can try using "127.0.0.1" as the database name instead of "localhost"; this will connect using a method that doesn't use the socket file.

That being said, if you can successfully connect and use your database with the mysql command, you shouldn't need to do anything special to get Omeka to connect.

not sure what's going on, but when I used 127.0.0.1 instead of "localhost" it all works fine, so thank you!
and if you feel like explaining further and helping me configure so that "localhost" works, I'd be glad to understand, if not, thanks a bunch for the help to get it going

Hi there,

I am trying to install omeka and am having issues getting the db.ini file correct.

My host name (I am using my numerical host IP set of numbers) user and pass are all correct. I am using the dbname i created on my host (it doesn't start with any kind of mysql or anything, like shown on the installation video)... but it is still showing that I have not uploaded any files to my site - even though on FTP, they are all there.

So, what am I supposed to put in these fields:

prefix = "omeka_"
charset = "utf8_unicode_ci"
;port = ""

Thanks so much,
Ruth

Hey!

I'm having the same problem with the db.ini message. I haven't used all the suggestions that all these wonderful people have posted but while I work on that I was just wondering if anyone could explain this problem. I've been using this database (omeka.oise.utoronto.ca)for months so I don't understand why it stopped working now.

Thanks!

Basically, you usually see the "No such file or directory" error when the PHP socket and MySQL socket settings don't point to the same path.

Using "127.0.0.1" instead of "localhost" doesn't try to use the socket file to connect, so that often fixes the problem. You can also fix the issue by correctly setting the php.ini value mysql.default_sock (you might need to check with your host or IT to do this).

I have just created a database called bohdanpawlowicz_omeka in my bohdanpawlowicz.org domain and uploaded Omeka to a folder I called suitcase as I already have a Wordpress install at the root.
I filled my db.ini file with the required info, according to instructions
http://omeka.org/codex/Database_Configuration_File

However, I get a connection error to the database.
http://bohdanpawlowicz.org/suitcase/
Omeka Database Error

Unknown MySQL server host '“localhost”' (2).
Confirm that the information in your db.ini file is correct.

What is it that I'm doing wrong and how can I correct it?

I've seen some variation in how single and double quotation marks get handled on different servers. Maybe try editing the db.ini file to try using or not using ' or " in the config lines?

Thanks, Patrick. Problem solvef by server support. The db.ini file was correctly spelt but for some reason or another got all bugged up when uploaded with bizarre interpositions like ~@~.
This is, according to support a difference in editors ( Linux and Windows) . Once corrected. I was able to install it.