Python connect to DB in MAYA (Part I)
First, you will have to setup the basic SQL.
Create a database schema and name it maya
SQL Instruction:
USE maya;
CREATE TABLE `python_test` (
`id` int(10) unsigned NOT NULL auto_increment,
`maya_cmd` varchar(50) NOT NULL,
`cmd_description` varchar(100) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT;
INSERT INTO `python_test` (`id`, `maya_cmd`, `cmd_description`) VALUES (1, 'polyCube', 'create a poly cube'),
(2, 'polySphere', 'create a poly sphere'),
(3, 'polyCylinder', 'create a poly cylinder'),
(4, 'polyCone', 'create a poly cone');
You should be able to see a database table `python_test` as shown below:
+----+--------------+------------------------+
| id | maya_cmd | cmd_description |
+----+--------------+------------------------+
| 1 | polyCube | create a poly cube |
| 2 | polySphere | create a poly sphere |
| 3 | polyCylinder | create a poly cylinder |
| 4 | polyCone | create a poly cone |
+----+--------------+------------------------+
4 rows in set (0.00 sec)
COMMENTS: If you have any enquiry, please comment or feedback here. |
Chris Chia