Topic on Project:Support desk

1044 Error Cannot Create Database

9
24.93.251.64 (talkcontribs)

MediaWiki version 1.17.0 PHP version 5.2.14 MySQL version 5.0.92-community

Below is a copy and paste of the installation error. My correct user name has been replaced with USER, and the directory path has been removed up to the actual wiki folder. The DB user name is correct as I used it 2 days ago to install another wiki software but removed due to lack of support.

MediaWiki 1.17.0 installation

Setting up database...A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was: CREATE DATABASE `wiki` from within function "MysqlInstaller::setupDatabase". Database returned error "1044: Access denied for user 'USER'@'localhost' to database 'wiki' (localhost)". Backtrace:

  1. 0 /wiki/includes/db/Database.php(751): DatabaseBase->reportQueryError('Access denied f...', 1044, 'CREATE DATABASE...', 'MysqlInstaller:...', false)
  2. 1 /wiki/includes/installer/MysqlInstaller.php(415): DatabaseBase->query('CREATE DATABASE...', 'MysqlInstaller:...')
  3. 2 /wiki/includes/installer/Installer.php(1314): MysqlInstaller->setupDatabase(Object(MysqlInstaller))
  4. 3 /wiki/includes/installer/WebInstallerPage.php(1084): Installer->performInstallation(Array, Object(MysqlInstaller))
  5. 4 /wiki/includes/installer/WebInstaller.php(250): WebInstaller_Install->execute(Array, Array)
  6. 5 /wiki/mw-config/index.php(46): WebInstaller->execute()
  7. 6 /wiki/mw-config/index.php(14): wfInstallerMain()
  8. 7 {main}
50.51.159.206 (talkcontribs)
50.92.165.62 (talkcontribs)
161.43.253.57 (talkcontribs)

I had the same issue... I could create the dbase manually but I am getting the same error... what is the trouble? I am guessing this is a simply misconfiguration on my part my I am missing it...

161.43.253.57 (talkcontribs)

Ouch - overlooked a very critical piece.

1. create the table yourself in cpanel or whatever you use. 2. note the exact table name... often this is USERNAME_tablename --- this is where I screwed up because I was just trying tablename

And then it worked.

Wargo (talkcontribs)

Have you permissions to create a new database? Try to create it manually.

50.195.135.119 (talkcontribs)

Basically, this is a probably a case of privilege. You do not have privilege to create a new database (i.e. wiki). But you can still create new table. So what you can do is:

  1. Under database, enter your existing database (check via phpmyadmin)
  2. Under prefix, enter 'wiki_' (the underscore will separate the table name and the prefix)

This should resolve the error, as it did for me.

173.81.177.176 (talkcontribs)

This is a very very late reply, but I had the same problem today and just figured out a solution that wasn't listed here. If you're installing MediaWiki through certain hosting companies (HostGator in my case) you have to not only create the database and db user in your cPanel, but you also have to give your user permission to control the database in cPanel before MW can complete the install.

DragnDon (talkcontribs)

Seems that I am getting this same error with my roster (Ionos, formerly 1and1). What is weird for me is that it's getting a 'Error 1044: Access denied for user "<some random username that looks like a password>". With Sonos, you create the username/pw/database all ahead of time and I put it into the setup. It seems like MediaWiki is trying to create something that already exists. With a WP install, I simply put these credentials into a config file and the install goes smoothly. Any advise would be greatly appreciated!

Reply to "1044 Error Cannot Create Database"