Suptisree BiswasKnowledge Contributor
How do you create a table in the data directory?
How do you create a table in the data directory?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Questions | Answers | Discussions | Knowledge sharing | Communities & more.
To creat a table in data directory you must follow the steps:
1. Connect to MySQL: Open MySQL command-line or Workbench.
2. Create Database: If needed, CREATE DATABASE dbname;
3. Use Database: `USE dbname;`.
4. Create Table:
sql
CREATE TABLE users
(
id INT AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(50) NOT
NULL,
email VARCHAR(100) NOT
NULL
);
5. Verify: `SHOW TABLES;` to see `users` table.
mysql > CREATE
TABLE t2 (c1 INT PRIMARY KEY)
TABLESPACE =
innodb_file_per_table DATA
DIRECTORY = ‘/external/directory’;