Home > Back-end >  How to build a data table in MySQL
How to build a data table in MySQL

Time:12-04

I want to use c + + code to implement the new table in MySQL,
What function?
(you can give the C language function, then my own packaging)

CodePudding user response:

To use the MSSQL SDK

CodePudding user response:

The
refer to the original poster abcd7038 response:
I want to use c + + code to realize the new table in MySQL,
What function?
(can give the C language function, when the time comes I wrapped)

String createtablestr="CREATE TABLE IF NOT EXISTS user_Manage (` ID ` int (11), NOT NULL AUTO_INCREMENT, ` USER ` varchar (32) NOT NULL, ` PWD ` varchar (32) DEFAULT NULL, PRIMARY KEY (` ID `, ` USER `)) ENGINE=InnoDB DEFAULT CHARSET=utf8";
Mysql_query (PSQL, createtablestr c_str ());

CodePudding user response:

The
reference 1/f, Simple, Soft reply:
to use MSSQL SDK

Details of which function?
Parameter is?

CodePudding user response:

refer to the second floor gouyanfen response:
Quote: refer to the original poster abcd7038 response:
I want to use c + + code to implement the new table in MySQL,
What function?
(can give the C language function, when the time comes I wrapped)

String createtablestr="CREATE TABLE IF NOT EXISTS user_Manage (` ID ` int (11), NOT NULL AUTO_INCREMENT, ` USER ` varchar (32) NOT NULL, ` PWD ` varchar (32) DEFAULT NULL, PRIMARY KEY (` ID `, ` USER `)) ENGINE=InnoDB DEFAULT CHARSET=utf8";
Mysql_query (PSQL, createtablestr c_str ());

Hello, PSQL is what?

CodePudding user response:

The
reference 3 floor abcd7038 response:
Quote: reference 1/f, Simple, Soft reply:
to use MSSQL SDK

Details of which function?
Parameter is?

To install mysql connector

CodePudding user response:

Simple reference 5 floor - Soft reply:
Quote: refer to the third floor abcd7038 response:
Quote: reference 1/f, Simple, Soft reply:
to use MSSQL SDK

Details of which function?
Parameter is?

To install mysql connector

I have installed the ODBC

CodePudding user response:

refer to 6th floor abcd7038 response:
I already installed ODBC

Use the ExecuteSQL??
Data sources: programmatically create the tables in the ODBC data source

CodePudding user response:

I am using MySQL, use the CREATE statement to CREATE a new table, such as establishing a student table (student id, name, department, class, age) :
 CREATE TABLE student (
Sno char (5) primary key,
Sname char (8)
Sdept char (2) NOT NULL
Sclass char (2) NOT NULL
Sage numeric (2)
);

In MySQL can also use the graphical interface to create a table: table - new & gt; Add fields - & gt; Design what you need to watch some of the properties of columns

CodePudding user response:

refer to the eighth floor Liu Dadong response:
I am using MySQL, use the CREATE statement to CREATE a new table, such as establishing a student table (student id, name, department, class, age) :
 CREATE TABLE student (
Sno char (5) primary key,
Sname char (8)
Sdept char (2) NOT NULL
Sclass char (2) NOT NULL
Sage numeric (2)
);

In MySQL can also use the graphical interface to create a table: table - new & gt; Add fields - & gt; Design what you need to watch some of the properties listed

This you use the CMD command line statement?

CodePudding user response:




refer to the eighth floor Liu Dadong response:
I am using MySQL, use the CREATE statement to CREATE a new table, such as establishing a student table (student id, name, department, class, age) :
 CREATE TABLE student (
Sno char (5) primary key,
Sname char (8)
Sdept char (2) NOT NULL
Sclass char (2) NOT NULL
Sage numeric (2)
);

In MySQL can also use the graphical interface to create a table: table - new & gt; Add fields - & gt; Design what you need to watch some of the properties listed

Thank you for your reply, but I want to c + + statements

CodePudding user response:

references 9 f abcd7038 response:
Quote: refer to the eighth floor Liu Dadong response:
is to use MySQL, I use the CREATE statement to CREATE a new table, such as establishing a student table (student id, name, department, class, age) :
 CREATE TABLE student (
Sno char (5) primary key,
Sname char (8)
Sdept char (2) NOT NULL
Sclass char (2) NOT NULL
Sage numeric (2)
);

In MySQL can also use the graphical interface to create a table: table - new & gt; Add fields - & gt; Design what you need to watch some of the properties listed

This you use the CMD command line statement?

Yes, this is the command statements, is based on c + +, this method is more simple,

CodePudding user response:

11 references Liu Dadong response:
Quote: references 9 f abcd7038 response:
Quote: refer to the eighth floor Liu Dadong response:
is to use MySQL, I use the CREATE statement to CREATE a new table, such as establishing a student table (student id, name, department, class, age) :
 CREATE TABLE student (
Sno char (5) primary key,
Sname char (8)
Sdept char (2) NOT NULL
Sclass char (2) NOT NULL
Sage numeric (2)
);

In MySQL can also use the graphical interface to create a table: table - new & gt; Add fields - & gt; Design what you need to watch some of the properties listed

This you use the CMD command line statement?

Yes, this is the command statements, is based on c + +, this method is more simple,

Can use C + + functions (or C function) to achieve this?
Thank you!

CodePudding user response:

C + + is not directly create a Mysql table, need to connect to a Mysql connection in c + + library execute SQL statements,
At the end of the day or SQL statements, the c + + code to see what use connection/library
For example,
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related