I am trying to use some variables in a script to create database settings. I'm not quite sure how to use them. Please explain how to format my code correctly. Below is the code I'm trying to execute and the error I am getting:
SET @username = 'xxxx';
SET @password = 'xxxxxx';
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' ;
Mistake
I also tried it without `
Trying to solve EdmundG
SET @username = 'xxxx';
SET @password = 'xxxxxx';
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=****;' ;
does not work, still says that it is not formatted correctly
source
share