Cannot get MySQL database to change character set - mysql

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.

Related

Error creating new User in MySQL workbench

I am getting an error in my SQL workbench when I create a user in my db.
I was given a schema to upload to my db I imported it successfully with no errors in Data import/restore tab. I have the correct userName and password but any time I try and save a user I get this same error.
I've checked the tables > Columns folder and I see the name column is listed. And I've tried dropping the db / schema and starting from scratch a couple times just incase something went wrong with that part.
I am new to using MySQL and working with DB's and schemas in general. So I'm not sure where to look to solve this error. I could use an idea of where this error could be coming from? And any advice on handling it.

#1010 - Error dropping database (can't rmdir './my_ucf_database', errno: 39 "Directory not empty") What do I do to drop this database? [duplicate]

This question already has answers here:
MySQL: Error dropping database (errno 13; errno 17; errno 39)
(8 answers)
Closed 1 year ago.
I am relatively new to phpmyadmin and I have been using xampp for class. I am running Ubuntu 20.04 and all I want to do is drop a database but it will not let me and it shows the error
#1010 - Error dropping database (can't rmdir './my_ucf_database', errno: 39 "Directory not empty")
I have searched the web for the answer and I cannot find it anywhere, will someone please help me solve this annoying problem. I just wanna delete this database, whats even stranger is that it is completely empty whenever I look at it. I cannot find the file on my Ubuntu laptop and I am at my wits end. Please help me.
The question is not relative to PHPMyAdmin.
The database in MySQL is a directory registered in system database which will contain all files relative to this database. All these files will be created by MySQL, and all of them will be registered too. MySQL supposed that none other files will be placed into this directory.
When you send a command to drop the database MySQL removes all files which are registered then removes the directory itself. If any problem during this process performing occures (some file or the directory itself cannot be removed due to any reason) the command fails with according error (provided by OS filesystem).
You must remove excess files placed into the database directory before dropping the database. MySQL itself will remove them never. If MySQL reports about some problem then you must eliminate the problem (remove excess file, fix incorrect attributes/access rights/etc.) in the filesystem then repeat DB dropping attempt.

Create tablespace "error in creating database file, access denied (OS 5)"

I try to create a database file. I've checked the route and everything, I've tried several times to create the tablespace (I've changed to capital letter, the ' for "...) like this...
create tablespace uinstitucion datafile 'C:\app\uinstitucion\oradata\uinstitucion\uinstitucion.dbf' size 500M ;
file create error, unable to create file", "unable to open file", "(OS 5) access denied" (but I am logged as SYSTEM!)
... as you can see, I was just lead to several errors. What can I do? What am I doing wrong? I'm desperate since yesterday, and my teacher does not seem to notice the exact error.
I've also tried the order like
CREATE TABLESPACE lmtbsb DATAFILE 'file_path/lmtbsb01.dbf' SIZE 50M
EXTENT MANAGEMENT LOCAL AUTOALLOCATE;
but it leads me to the same error.
I'm sorry I cannot post a picture, it would be more descriptive, but I am not allowed yet.
Please run your SQLplus as an administrator and then connect and try to execute it.
You error says that you have no privileges to create file. This comes from operating system. Path looks for Windows so please try right click on SQLplus (or any other client you're using), choose run as administrator and then continue.

Easy PHP and mysql ..php cannot see database on local pc (all works on server)

I have a website written in php and mysql (written by someone else) and I need to alter it- just for your interest it is bridgetjonesart.co.uk. So I thought I would download it to my desktop pc and use easy php and mysql locally to make changes then upload it again.
I seem to have downloaded everything okay. I first just tried to run existing php using Easy Php and got
Warning: mysql_connect(): Access denied for user 'runningc'#'localhost' (using password: YES) in C:\Program Files (x86)\EasyPHP-12.1\www\backup from runningc\public_html\bridgetjonesart.co.uk\mysqlLogin\mysql_connect.php on line 6
Could not connect to database. Error
I have the sql database as a file 'runningc_bjart.sql' in the root directory but I think the php cant see it so I tried to use easy php administration, phpmyadmin and thought perhaps I should import the 'runningc_bjart.sql' file. So I tried and got an error message ...
Error
SQL query:
--
-- Table structure for table `Blog`
--
DROP TABLE IF EXISTS `Blog` ;
MySQL said: Documentation
#1046 - No database selected
I am not sure what to try next, any help would be really appreciated.
Thank you. Bridget
The error messages are VERY clear.
Error #1: You're using the incorrect credentials, or have forgotten to grant rights on your database to the credentials you're using.
Error #2: You've forgotten to set a default database, so MySQL has no idea which database it should be looking in for the table you're trying to drop.
e.g. you need
mysql_select_db('mydatabase');
or change your DROP query to be
DROP TABLE mydatabase.Blog;
With phpmyadmin, create a new database named runningc_bjart and import the file there. Then search in your project for a config file where the db password is set and change it with your local mysql password

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

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.