I am trying to use some variables in a creation script for database setups. I am not exactly sure how to use them. Please explain how to properly format my code. Below is the code I try, and the error I get:
SET @username = 'xxxx'; -- store number goes here
SET @password = 'xxxxxx'; -- store password goes here
CREATE TABLE IF NOT EXISTS `my_table` (
`id` int(11) auto_increment,
`release_date` datetime,
`front_image_file` varchar(255),
PRIMARY KEY (`id`)
) ENGINE=FEDERATED
DEFAULT CHARSET=latin1
AUTO_INCREMENT=1
CONNECTION='mysql://`@username`:`@password`@host_name:3306/database_name/table_tame' ;
error
#1432 - Can't create federated table. The data source connection string 'mysql://`@username`:`@password`@host_name:3306/databa' is not in the correct format
I also tried it without the `
Trying EdmundG's solution
SET @username = 'xxxx'; -- store number goes here
SET @password = 'xxxxxx'; -- store password goes here
CREATE TABLE IF NOT EXISTS `my_table` (
`id` int(11) auto_increment,
`release_date` datetime,
`front_image_file` varchar(255),
PRIMARY KEY (`id`)
) ENGINE=FEDERATED
DEFAULT CHARSET=latin1
AUTO_INCREMENT=1
CONNECTION='Uid=@username; Pwd=@password; Server=****; Port=3306; Database =****; Table=****;' ;
didn't work, still says not formatted correctly