title: Terminal INSERT into MySQL Not Working
body: <p>I im creating mysql script that creates database, tables and insert data into created table...but i need to do it using ubuntu terminal..i successfully created database and tables but my INSERT sql statement does not insert nothing into table...</p>
  
  <pre><code>echo "CREATE DATABASE "mydatabase"" | mysql -uroot -pPASSWORD; \
  echo "DROP TABLE IF EXISTS "servers";" | mysql -uroot -pPASSWORD mydatabase; \   
  echo "CREATE TABLE "servers" ( \
      "id" int(2) NOT NULL AUTO_INCREMENT, \
      "server" varchar(64) NOT NULL, \
      "ip" int(10) unsigned NOT NULL, \
      "panel" int(4) NOT NULL, \
      PRIMARY KEY ("id") \
      ) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;" | mysql -uroot -pPASSWORD mydatabase; \
      echo "LOCK TABLES "servers" WRITE;" | mysql -uroot -pPASSWORD mydatabase; \
  </code></pre>
  
  <p>This code above works and creates database and tables and next command does not insert into table from terminal and i could not find any errors...so why is not inserting into table?</p>
  
  <pre><code>echo "INSERT INTO servers (id, server, ip, panel) VALUES (1, \''+rows[0].server+'\', \'INET_ATON('+rows[0].ip+')\', '+rows[0].panel+');" | mysql -uroot -pPASSWORD mydatabase; \
  echo "UNLOCK TABLES;" | mysql -uroot -pPASSWORD mydatabase;
  </code></pre>