Run Sql file in MYSQL PHPMyadmin - mysql

I have written the SQL file with on excecuting it is throwing the error as
mysql> #"C:\Documents and Settings\Hemant\Desktop\create_tables.sql";
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near '#"C:\
Documents and Settings\Hemant\Desktop\create_tables.sql"' at line 1
on line 1 code is
CREATE DATABASE IF NOT EXISTS test;
DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE test;
please let me know is i am missing something

Correct me if I'm wrong, but isn't there a table test by default when you setup PHPMyAdmin?

You have an extra semi column after test.
Try removing it and see if that fixes the issue.

Related

Create database in SQL and get an error but everything right

I try to install fleetspeak. Use Ubuntu 18.04.
First of all I run this
CREATE USER 'fleetspeak-user' IDENTIFIED BY 'fleetspeak-password';
Then I want to create database with this
CREATE DATABASE 'fleetspeak';
But has an error:
ERROR 1064 (42000): You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right
syntax to use near ''fleetspeak'' at line 1
Why I can get this?
Try the create database script without single quotes in dbname
CREATE DATABASE fleetspeak;

MySQL 8: Alter definer of stored procedure

In versions of MySQL prior to 8, altering the definer of a stored procedure is possible by manipulating the mysql.proc table. This table was removed in 8 and replaced by the data dictionary. It looks like the definer can be modified using ALTER PROCEDURE, but for the life of me I cannot get the syntax specified to work.
mysql> alter procedure refresh_basic sql security definer=`foo`#`127.0.0.1`;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '=`foo`#`127.0.0.1`' at line 1
mysql> alter procedure refresh_basic sql security definer='foo#127.0.0.1';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '='foo#127.0.0.1'' at line 1
I also tried both of the above without using =, but got similar errors. How does one actually do this? Thanks!

MySQL commands not working in phpMyAdmin

I am able to create databases and tables using the User Interface in phpMyAdmin , but when I do the same using MySQL commands , It does not work. I get this error :
SQL query:
DROP DATABASE 'alphacrm'
MySQL said: Documentation
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''alphacrm'' at line 1**
don't use quote
DROP DATABASE alphacrm;
my sql object don't need quotes eventually use backtics for reversed word and compite named eg:
`my obj`

Error while Importing MySQL dump into Aurora

I took a dump of my RDS MySQL database(5.7) with utf8 as character set and collation. Intent is to migrate the database to Aurora 5.6. During the import, I see an error where it complains about the query being incorrect. Now this is the dump file that mysql generated so my guess is that its having problem inserting the data in question. I checked for that data string in the dump and it does exist but I see nothing wrong in it. Here's the error I get during import. Any pointers ?
ERROR 1064 (42000): You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right
syntax to use near ''2352eb05-7596-3' at line 1

restoring mysql backup

I'm trying to restore database from backup. I've create new DB:
CREATE DATABASE `my_db` CHARACTER SET utf8
after that I launch big sql, afrter some time there written
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near ''oy7:
commandwy24:BroadcastCommandContentsy15:changeStructure:7y7:1080582i15ay7:1' at
line 1
Does anyone know what's up here? I've tried on two backups, and I don't think both are invalid.
Thank you in advance!