MySQL/Writing file error (Errcode 28) on creating database - mysql

I have the following error on execute sql file or creating database by entity framework code first approach
Error writing file '.\dbdemo\ads.frm' (Errcode: 28)
On local database server it is working fine and creating database by EF Code First Approach but
on my website hosting server facing this problem.I have tried both techniques by executing sql file and creating database EF Code First Approach both failed.
Any idea how to solve this error !

Use the perror command:
$ perror 28
OS error code 28: No space left on device
Unless error codes are different on your system, your file system is full.
Refer MySQL Docs.
This blog explains about the error. And this too.
MySQL created a temporary table, using the MyISAM storage engine, and when the disk filled up, MyISAM got an error.
So try clearing the temp folder.

Related

Why is there an error with the source command in MySQL

I'm trying to add the employee sample database for practicing with MySQL however there's an error since there's a source command and from what I've found it says that MySQL doesn't support this command anymore.
So, how could I add the complete database without any error?
[this is the code line where the source command is called]
SOURCE is one of the mysql client builtin commands. These are recognized by the mysql client, but not by the MySQL Server's SQL parser.
See https://dev.mysql.com/doc/refman/8.0/en/mysql-commands.html

Running a MySQL Script - with zero knowledge

A client has just supplied me with two long files which are (apparently) scripts that I can run in MySQL to generate a bunch of database tables.
I've installed MySQL (+ workbench) on my PC. From within the Workbench environment I found "run SQL script" under the File menu so I went with that and tried to run the two script files I have. They both fell over partway though giving me error messages:
Finished executing script
ERROR 2006 (HY000) at line 1930: MySQL server has gone away
Operation failed with exitcode 1
and
Finished executing script
ERROR 2006 (HY000) at line 20201: MySQL server has gone away
Operation failed with exitcode 1
I can however see two schemas, both of which contain a bunch of tables, etc. (some of which are populated) so it seems to have been a partial success at least.
Can anyway suggest what might be wrong please?
Thank you.
I can point you at a solved example on stackoverflow for this MySQL error, but the simplest solution is to edit your sql file(s) placing this query at the top:
set SESSION max_allowed_packet=64*1024*1024

Moved mysql database but no joy

it started out with a mysqldump not making a good file so importing to another server would bomb. The last line of the sql file has this text in it:
mysqldump: Couldn't execute 'show events': Cannot proceed because system tables used by Event Scheduler were found damaged at server start (1577)
I then searched on this site for some other options and found the option of jsut grabbing the folder that contains the database and moving it to the other server. I tried that but then i get:
SQL show index from archived_import_log failed : Table 'cgaxf_800080.archived_import_log' doesn't exist
Now i am at a loss..any ideas?

IIS Site Getting Hacked?

I am running IIS 8.5 on a Windows 2012 R2 virtual server.
The server has MySQL Server 5.5.44 installed, and I connect to it using Classic ASP pages via a MySQL ODBC 5.1 Driver.
Recently I have been getting issues in my error log with errors such as:
[MySQL][ODBC 5.1 Driver][mysqld-5.5.44]Error on delete of 'C:\Windows\TEMP\#sql1718_1ca27_2d.MYI' (Errcode: 13)
And
[MySQL][ODBC 5.1 Driver][mysqld-5.5.44]Can't find file: 'v_pdf_log' (errno: 2)
I have been able to normally go into the MySQL admin application (SQLYog) and repair the database, and the problem is fixed.
However, I think someone is trying to break the site as some strange URLs are getting called, such as:
mysite/mypage.asp?id=999999.9"+%2f**%2fuNiOn%2f**%2faLl+%2f**%2fsElEcT+0x393133353134353632312e39+and+"0"="0
These are URLs from Moscow. Presumably this is an SQL Injection attack is it?
Can they somehow delete actual MD Files from the MySQL folder? Presumably not, but they have done something.
And yes, I'm a stupid person who didn't parameterise my queries in my code...
Use Parameterized queries and give the DB login the least privilege possible.
Also use stored procedures whenever possible

Cannot get MySQL database to change character set

I was getting an "Illegal mix of collations" error on my database, so I figured I should go ahead and set my database and all tables to UTF-8.
I found the command on how to do that () but I got the following error:
1 - Can't create/write to file './databasename/db.opt' (Errcode: 2)
I then found this to help: MySQL Error 1 (HY000) Trouble creating file Errcode 2 but the solution didn't work. I still get the same error.
I don't know what to do other than to drop the database and restore it, but that seems like a bit of an extreme solution. I'm also struggling to figure out how I can alter all the tables in the database, again short of a dump and restore.
Does anyone have suggestions on how I can fix this bug? Is dropping the database my only option? Is there some permission I'm unaware of?
This question is quite old, but putting this answer here for future reference.
The way I was able to resolve it was by logging into the mysql instance with root user credentials.
The reason the above error occurs (1 - Can't create/write to file './databasename/db.opt' (Errcode: 2) is a result of a permissions issue. The currently logged in mysql user doesn't have write permissions for modifying that directory.
Using the 'root' user account resolved this error message.