
In PostgreSQL, you can see what databases have been created with the following command: To see what databases exist in your MySQL or MariaDB installation, run the following command: CREATE DATABASE database_name CHARACTER SET character_set COLLATE collation.If you want your database to use a character set and collation different than the defaults, you can specify those using this syntax: The following command creates a database with default settings.
#BASE ONE CHEAT TABLE PASSWORD#
If you’d like to supply your password as part of the command, immediately follow the -p option with your password, with no space between them: The above command will prompt you for your password after you run it. If you’ve already set up a non-root user account for your database, you can also use this method to log in as that user: If your root MySQL user is set to authenticate with a password, you can do so with the following command: Opening up the Database Prompt (using Password Authentication) This example will log you in as the postgres user, which is the included superuser role, but you can replace that with any already-created role: To open up a PostgreSQL prompt, use the following command. Opening up the Database Prompt (using Socket/Trust Authentication)īy default on Ubuntu 18.04, the root MySQL user can authenticate without a password using the following command: Where there are significant differences between RDBMSs, we have included the alternative commands. This guide uses MySQL as the example relational database management system (RDBMS), but the commands given will work with other relational database programs, including PostgreSQL, MariaDB, and SQLite. Please note that, while SQL is recognized as a standard, most SQL database programs have their own proprietary extensions. This isn’t required for numeric data, but it also won’t cause any issues if you do include apostrophes. In SQL, it is necessary to wrap any data values that consist of strings in apostrophes.

SQL databases come installed with all the commands you need to add, modify, delete, and query your data.
