errno 2

autotron

Verified User
Joined
Jul 7, 2011
Messages
7
I have recently had directadmin installed on a server I am renting, I recently tried to create a database through the admin account and a reseller account I fill in all fields as required and when I click on create I always get this error
Error creating the database

Details


Unable to create database admin_admin. Can't create database 'admin_admin' (errno: 2)

I am no stranger to DA and have 4 other servers all with direct admin all include 5 IP and all have 4-5 reseller accounts and I have had no issues creating databases on any...so seems like a bad install to me, can some one here please tell me how to correct this issue?
 
What happens if you name the database something else? Do you still have the same problem?
 
I have tried many different names and passwords, all the same result. I tried admin on another server and it worked fine...I did browse these forums a bit last night and tried a bunch of things like updating DA then tried updating Mysql, when I tried that I got error when it tried stopping Mysql then another saying /home/Mysql/ does not exist, looked and nope not there...but on my other servers it's not there either so don't know. The only differences between servers I can see is one runs centos (the working one) the other is debian...so thinking somehow /home/Mysql/ directory got deleted or corrupt somehow and is the cause...not sure how to replace that though
 
You could try recreating /home/mysql (all small case letters). Make sure to chown mysql:mysql the dir and restart mysql.
 
/home/mysql isnt needed. I dont even have one on my system.

Try:

cat /var/lib/mysql/`hostname`.err
 
Is the database name really admin_admin? That could be for some reason not allowed. The admin prefex isn't changeable, but the latter part is.

Jeff
 
What happens when you try to create this database from your Linux command line?
 
I have tried different names no go, I cant login to mysql...I do
server:/usr/local/mysql/bin# mysql -u root -p
get password prompt, tried my root pass and my DA pass neither work, Dont know how to reset the pass...is this mysql the same as what is stored in /home/mysql on a debian server? if so is it possible to change a config file to point there instead?
running out of options my need just dump the server and get a new one...just kinda expensive
 
You can find the mysql root pass in /usr/local/directadmin/scripts/setup.txt

If I understand correctly, this is a new installation and you don't have any mysql databases right now? Try rebuilding mysql.

cd /usr/local/directadmin/custombuild
./build mysql
 
When I try to create a database manualy i get

mysql> create database test;
ERROR 1006 (HY000): Can't create database 'test' (errno: 2)

if I try ./build mysql i get

server:/usr/local/directadmin/custombuild# ./build mysql
./build: line 3026: cd: /home/mysql: No such file or directory
Dumping database configure
mysqldump: Got error: 1049: Unknown database 'configure' when selecting the database
Dumping database mysql_backups
mysqldump: Got error: 1049: Unknown database 'mysql_backups' when selecting the database
Stopping mysqld ...
Stopping mysqld: [ FAILED ]
tar: mysql-5.5.13-linux2.6-x86_64/data/mysql/.empty: Cannot open: No such file or directory
tar: mysql-5.5.13-linux2.6-x86_64/data/test/.empty: Cannot open: No such file or directory
tar: Error exit delayed from previous errors
chown: cannot access `/home/mysql': No such file or directory
mysqld is already running. ${SOCK} exists
Giving mysqld a few seconds to start up...
Looking for 'mysql' as: /usr/local/mysql/bin/mysql
Looking for 'mysqlcheck' as: /usr/local/mysql/bin/mysqlcheck
Running 'mysqlcheck with default connection arguments
Running 'mysqlcheck with default connection arguments
Running 'mysql_fix_privilege_tables'...
ERROR 1049 (42000): Unknown database 'mysql'
FATAL ERROR: Upgrade failed
Restarting MySQL.
Stopping mysqld: [ FAILED ]
mysqld is already running. ${SOCK} exists
It is recommended to do "./build php n" after MySQL update.

any ideas?
 
Hello,

Custombuild is only used to change versions. It doesn't actually set anything up, or change permissions on things.

1) Check this guide:
http://help.directadmin.com/item.php?id=45

with:
/usr/local/directadmin/conf/mysql.conf

the user/pass set there should be the same that you see in the error (usually da_admin, and not admin_admin)

If you see admin_admin in the error, but da_admin in the mysql.conf, that means that there is a my.cnf or .my.cnf somewhere breaking the settings:
http://help.directadmin.com/item.php?id=329

2) Also check permissions. If you can login to mysql as root or da_admin, then if you get a permission error when creation a database, check permissions on /home/mysql or /var/lib/mysql. It should be set to mysql:mysql for all files and folders.

3) If you're missing the "mysql" database, then you'll missing all things of importance, so you'll want to start over for mysql.

Type:
Code:
cd /usr/local/directadmin/scripts
./mysql.sh [b]rootpassword[/b] da_admin [b]daadminpass[/b]
where you can set anything you want for the bold passwords.

Related:
http://help.directadmin.com/item.php?id=355

John
 
Back
Top