15

I'm trying to install mybb on a server but the admin is taking too long to respond. I have all the information I need except the database name. Is there a default name for mysql on a linux server?

1
  • move to dba.stackexchange.com Commented Apr 26 at 22:55

4 Answers 4

26

There is no default database.

A fresh MySQL server install will have 0 databases. The install script will run mysql_install_db after the server is running to create a mysql database, which MySQL uses to store users and privileges. Don't put your data there.

You can create your own databases by issuing CREATE DATABASE [name] queries if your user has permission.

Sign up to request clarification or add additional context in comments.

2 Comments

0 databases, with the exception of information_schema, of course.
Let me put it this way - A fresh MySQL server and MySQL shell install will have the following 4 databases: (Version 5.5.42): 1. information_schema 2. mysql 3. performance_schema 4. test
3

No default database in MySQL

MySQL does not create a database by default for you. If connecting to a fresh MySQL server, you will find four databases existing, described below.

4 databases in MySQL

When first connecting to a new MySQL 8.1 server on a terminal, like this:

mysql -u root -p -h localhost 

… at the prompt you can issue this SQL command to see all existing databases:

SHOW DATABASES ;

You will find four databases:

+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.00 sec)
  • The first is required by the SQL standard: information_schema. See Wikipedia. See doc.
  • According to this AI, mysql is a system schema for storing User Accounts, Access Control settings, Server Configuration settings, and system-level Stored Procedures and Functions. (I cannot find a page in the manual for this.)
  • performance_schema is a feature for monitoring MySQL Server execution at a low level. See doc.
  • sys is a set of objects that helps DBAs and developers interpret data collected by the Performance Schema. See doc.

We can then create a database for our own purposes.

CREATE DATABASE bogus_ ;

Tip: Use a trailing underscore on all your names. The SQL standard explicitly promises to never define a keyword with a trailing underscore. This approach eliminates any chance of collision with any of the over a thousand keywords and reserved words used across various SQL database products.

Comments

1
  1. Do you have full database access? Then just add a database with a name of your choice:

    CREATE DATABSE rob_bb;
    
  2. If you only have a normal user access, the database name is often the same as the username.

  3. Or you can run the query

    SHOW DATABASES;
    

to see what databases exist (which you are allowed to see).

2 Comments

where would i enter these commands? right now i have ftp access, and (i think) ssh
if you ssh in, you can use the command "mysql -p" to login to mysql. if you only have ftp, you can add a script file, for example php: <?php mysql_connect('localhost','username','password'); $resource = mysql_query("SHOW DATABASES"); while($result = mysql_fetch_assoc($resource)) { echo implode("\t", $result) . "\n"; } ?>
0

There are no default databases. If you were asking about default users 'root' would be it.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.