You need to tell MySQL which database to use:
USE database_name;
before you create a table.
In case the database does not exist, you need to create it as:
CREATE DATABASE database_name;
followed by:
USE database_name;
More Related Contents:
- Join vs. sub-query
- Find records from one table which don’t exist in another
- How do I update if exists, insert if not (AKA “upsert” or “merge”) in MySQL?
- Natural Sort in MySQL
- MySQL get row position in ORDER BY
- Comparing date ranges
- Subqueries vs joins
- MySQL Results as comma separated list
- MySQL unknown column in ON clause
- Fulltext Search with InnoDB
- MySQL’s now() +1 day
- Rewriting mysql select to reduce time and writing tmp to disk
- Can you access the auto increment value in MySQL within one statement?
- Which SQL query is better, MATCH AGAINST or LIKE?
- Maintaining order in MySQL “IN” query
- MySQL: What is a reverse version of LIKE?
- Select TOP X (or bottom) percent for numeric values in MySQL
- How to create a multi-tenant database with shared table structures?
- MySQL #1140 – Mixing of GROUP columns
- MySQL select where column is not empty
- Hamming distance on binary strings in SQL
- Is it possible to have a default parameter for a mysql stored procedure?
- Renaming foreign-key columns in MySQL
- How to convert from varbinary to char/varchar in mysql
- MySQL GROUP BY behavior
- How to get rid of “Error 1329: No data – zero rows fetched, selected, or processed”
- Update multiple rows with one query?
- How to change string date to MySQL date format at time of import of CSV using MySQL’s LOAD DATA LOCAL INFILE
- I want to copy table contained from one database and insert onto another database table
- How do MySQL views work?