echo "drop table test;" |mysql --login-path=local -D 'test' mysql --login-path=local -D 'test' < test.sql echo "select User , Host from mysql.user;"|mysql --login-path=local echo "drop database if exists \`test\`;drop user if exists \`test\`@localhost;"|mysql --login-path=local echo "drop database if exists \`test\`;create database \`test\`;"| mysql --login-path=local echo "drop user if exists \`test\`@localhost;grant usage on *.* to \`test\`@localhost identified by '123456';"| mysql --login-path=local echo "grant all privileges on \`test\`.* to \`test\`@localhost ;"| mysql --login-path=local