データベース設定用の作成スクリプトでいくつかの変数を使用しようとしています。私はそれらをどのように使うべきか正確にはわかりません。私のコードを適切にフォーマットする方法を説明してください。以下は、私がしようとしたコードであり、誤差は私が取得:作成ステートメントの変数
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' ;
エラー
#1432 - Can't create federated table. The data source connection string 'mysql://`@username`:`@password`@host_name:3306/databa' is not in the correct format
私もEdmundGのソリューション
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='[email protected]; [email protected]; Server=****; Port=3306; Database =****; Table=****;' ;
のdidnをしようとすると、 `
せずにそれを試してみましたまだ正しくフォーマットされていないと言われています
私はhttp://dev.mysql.com/doc/refman/5.0/en/federated-use.htmlから接続文字列を持って、私はそこでの変数を持っていないときには正常に動作します。あなたが私のためにすべてを一緒に置くことができれば、それは素晴らしいだろう –
私はそれがうまくいくのか分からない。文字列でコマンド全体をラップして、EXECコールを使用する必要はありませんか? –
もちろん、そのコメントはSqlServer世界の誰かからのものです。おそらくそれはMySQLでは異なっているでしょう。 –