Mysql Collation does not work - mysql

I insert some text which i scrap from remote server and the problem is that in the text here is symbol.
� which makes a syntax error insert doe not work .Any ideas about this a
paradox????? I've tried almost all collation nothing works.Text is in armenian.
SQLSTATE[42000]: Syntax error or access violation: 1064 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 '
ՄԱԿ-ի գլխավոր քա�' at line 1
Thanks in advance

FIXED..!!!The problem was when create an instance of PDO I didn't mention this part
charset=utf8

Related

I can't read a database on mysql because of wrong syntax in the database name, but the database reads on other platforms like DBmaria

Hi please I am new to mysql and I'd love to know how to access a database with the name 'c-factory'. It seems mysql does not read it because of the '-' sign. I've been able to load it on dbmaria but I don't seem to be able to do it with mysql
SELECT * FROM c-factory
Error Code: 1064. 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 '-factory' at line 4 0.000 sec```

Mysql error #1064 in Drupal

I have a problem when I upload mysql from localhost to my server. The error message show like below.
Error
Static analysis:
1 errors were found during analysis.
A closing bracket was expected. (near ")" at position 76)
SQL query:
CREATE TABLE actions ( aid varchar(255) NOT NULL DEFAULT '0'COMMENT )
MySQL said: Documentation
1064 - 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 ')' at line 3
enter image description here
Please help me. how to fix this error....
I just try many ways to solve mysql error. Fortunately, I found the ways to fix it. Just update phpmyadmin version in localhost to be the same at server version.
Then, it's worked for me.
Hope this way help you to solve your error when you get the same at me.

Update ERROR Mysql

UPDATE User SET username='basta2',password=sha2('basta',512), role='User' disabled=0 WHERE username='basta';
This query should be correct in my opinion, but gives me this 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 'disabled=0 WHERE username='basta'' at line 1
What is wrong here?
As pointed by #vkp, the issue is a missing ,. Use this:
UPDATE User SET username='basta2',password=sha2('basta',512), role='User', disabled=0 WHERE username='basta';

MySQL Injection going wrong

I was testing security of a friend's site and I found SQL Injection vulnerability by putting ' at end of URL
The site is built in zend framework
The issue I am having is the comment syntax in MySQL -- is not working so the page is still throwing error
Exception: SQLSTATE[42000]: Syntax error or access violation: 1064 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 'order by 1--) ORDER BY companies.company_name ASC' at line 8
in /home/xxxxxxx/xxxxxxxxxx/lib/Zend/Db/Adapter/Abstract.php on line 157
If you look up the error, the query is not terminated after --
Even # and --+-is not working
By putting ' at the end of the URL and the website is throwing out an error doesn't always mean it's vulnerable against SQLi.

Can't create a view using the views module

I created a view using Views module based on the default node index. But the first thing I found is this error message:
SQLSTATE[42000]: Syntax error or access violation: 1064 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 '-1 OFFSET 0' at line 2
What might cause this and how do I solve it?
You have an error in your SQL syntax !
View module just GUI for create query
so you be sure your choice was Logical for create a query