Error installing mysql - mysql

Beginning configuration step: Initializing Database
Attempting to run MySQL Server with --initialize-insecure option...
Starting process for MySQL Server 8.0.11...
Starting process with command: C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe --defaults-file="C:\ProgramData\MySQL\MySQL Server 8.0\my.ini" --console --initialize-insecure=on...
2018-06-26T08:44:42.036600Z 0 [ERROR] [MY-011071] [Server] Unknown suffix '.' used for variable 'lower_case_table_names' (value '0.0')
2018-06-26T08:44:42.036600Z 0 [ERROR] [MY-011071] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe: Error while setting value '0.0' to 'lower_case_table_names'
2018-06-26T08:44:42.036600Z 0 [ERROR] [MY-010119] [Server] Aborting
2018-06-26T08:44:42.036600Z 0 [Note] [MY-010120] [Server] Binlog end
Process for mysqld, with ID 3232, was run successfully and exited with code 1.
Failed to start process for MySQL Server 8.0.11.
Database initialization failed.
Ended configuration step: Initializing Database
I am having this error in log during the installing of MySQL on the application configuration part.

Resolved following these steps:
- Rollback installation until initial page and choose remove mysql server
- Uninstall from add/remove programs mysql community installer
- reboot
- install version mysql-installer-web-community-5.7.22.1 and select update when it asks.
- done

This is a Bug in the Installer of 8.0.11.
There are changes in the lower_case_table_names variable in the new release. See:
https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-11.html
Nobody can fix this. If you installing the Server the configfile is write before new. Every time. So if you fix this 0.0 to 0 in my.ini the changes will be overwritten.
Somebody have to report a this bug to MySql.
EDIT:
I have report a bug to oracle:
https://bugs.mysql.com/bug.php?id=91539

The only way to get rid of this error is by allowing MySQL Installer to update when it prompts to do so at the beginning of the installation. Please note that you will get this error if you didn't allow the installer to update.
Updating lower_case_table_names = 0 in my.ini doesn't fix this because MySql will re-initialize it to 0.0 everytime before running the scripts.
If you didn't allow updates, you will need to uninstall all components of MySql and run the installer again and let it update.

First you have to uninstall mysql:
Step 1. control panel->programs and then uninstall whole mysql.
Step 2. delete folder MySQL from the following path.
C:\Program Files\MySQL
C:\Program Files (x86)\MySQL
C:\ProgramData\MySQL (your programdata folder is hidden so you have to unhide from c drive->views->options->view ->show hidden files)
4.C:\Users\hp(your pc name)\AppData\Roaming\MySQL
Step 3. windows+r write regedit.exe enter and follow the path and delete mysql Computer\HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\
Step 4. control panel->administrative tool->services then find mysql copy name then open cmd run as administrative write (sc Delete "mysql name that you copied")enter.
Now you can install MySQL

Update the installer for mysql-installer-web-community-5.7.22.1 file during the installation from the web . I encountered the same problem, after updating the installer it works correctly.

When I downgrade MySQL from 8.0.11 to 5.7.22, I encountered this error. Spend a lot of time to fix the bug. Finally, I fix this problem by the following steps:
uninstall all the related features with MySql( use Control Panel > Programs and Features)
go to C: drive, make all hidden files visible(view > hidden items), find ProgramData file
delete the MySql file inside hidden ProgramData file manually.
Make sure all the MySQL files are deleted, reinstall MySQL. It works for me. I successfully installed MySQL 5.7.22 without any problem.
My Guess: This error probably will happen if you are second or third time to install MySql server. It seems like the error happens because the old MySql files are not deleted completely. Usually, we all think that after we uninstall the application, the files are deleted from program files, it is clean, everything was done. However, there still some files hidden from us. We have to delete them by ourselves.

On bug page, last comment states that the latest installer solves this problem.
For me not. The following steps made me a clean install (after get the latest installer):
When it fails on database initialization step just cancel it back to the installer's main page where you can see installed MySQL server with a reconfigure option.
Now edit the my.ini and set the
"lower_case_table_names=0.0"
to
"lower_case_table_names=0"
Click on reconfigure and now it goes over on this problem.
Hope it helps.

I faced the same problem with 1.4.25 installer and resolved that by doing the following steps [without updating the installer]
There is a folder MySQL Installer for Windows\Manifest\Templates
In Templates folder there are few text files which are there to be used as a template during my.ini generation. I have commented out the line lower_case_table_names=
Now I execute the configuration process using installer and it executes without any error.Also I add the variable later and restart the server.

As the bug reported in https://bugs.mysql.com/bug.php?id=91476, upgrade MySQL installer to 1.4.26.0 and reinstall MySQL server would resolve the issue.

When I installed mysql server, wizard of installation was stooped at the point initializing database (if necessary) for that I did.
remove mysql folder from 'C:\ProgramData' folder. Note: ProgramData is hidden. You need to make it visible.
Uninstall mysql server if it was in the list of installed programs in control panel.
Download mysql-installer-web-community-8.0.13.0 and install it again.

I had the same problem, tried to change my.ini did't work, so I uninstalled the SQL server, then I google my operating system + Install MySQL videos (In my case "Install MySQL on Windows 8"), then I installed MySQL 5.6.26 then worked.
I think the newer MySQL doesn't support certain old operating system.

Related

Why won't MySQL start on my XAMPP install?

I've been running without any problem Wordpress locally on my W10 x64 PC for over a week.
I turned on my computer this morning, opened XAMPP 3.2.4 and I am unable to start the MySQL module.
"Error: MySQL shutdown unexpectedly."
At first it says:
16:25:35 [mysql] Attempting to start MySQL service... 16:25:35
[mysql] Status change detected: running
And then this:
16:25:43 [mysql] Error: MySQL shutdown unexpectedly.
I tried changing port, reinstalling services, removing some files in the MySQL data folder (trying to follow the online guides about problems similar to mine) but nothing worked.
When I manually try to start the MySQL service I get the error 1067.
I uploaded the error log file here:
https://drive.google.com/file/d/1q-wQm5a5uChF6_6UCsfVEBFoeSvKwh2E/view?usp=sharing
It seems that you have your first warning at:
2019-11-13 14:00:05 6 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1932: Table 'mysql.gtid_slave_pos' doesn't exist in engine
Do you have a replication schema woriking? if not, you can rename master.info files to avoid replication.
Besides that you have your first error related to files access:
2019-11-13 14:10:32 0 [ERROR] InnoDB: Cannot open datafile for read-only: '.\virtualnordicdb\wp_commentmeta.ibd' OS error: 203
Can you access that file and the file has correct the write/read privileges
And Finally you have space enough in your hard drive?
019-11-13 14:20:25 0 [Note] mysqld.exe: Aria engine: starting recovery
recovered pages: 0% 10%191113 14:20:26 [ERROR] mysqld got exception 0xc0000005 ;
I was able to fix this by unistalling and reinstalling XAMPP.
I then copied the website folder back in htdocs, and finally went to "mysql>data", copied the database folder of the website and pasted the "ibdata1" file that I had before reinstalling XAMPP.
I came up with this solution thanks to this answer on another post:
https://stackoverflow.com/a/50855748/12367579
I have been to this problem thousands of times.
This problem is related to some custom things such as other programs or duplication.
I can give you several solutions:
Check Control Panel
Maybe you have installed your Xampp several times. Go there and check on the bottom. If there are too many Xampp installs, uninstall them all. Don't forget to save your xampp folder with htdocs and mysql.
Check your programs installed on pc
There are too many suspicious programs like Teamviewer or VMWare that block the port of mysql. Try to uninstall it, and install them again after finishing work with your Xampp.
Changing the port
Go to XAMPP Control Panel and near to MYSQL go to Config > my.ini
Search for port=3306, and replace all occurrences' values with 3336.
After that, go to CONFIG at the top on the right, then to Service and Port Settings, after it at MYSQL tab.
On that tab change the value of port to 3336.
After that click save and then quit your XAMPP.

MariaDB on Windows 8 InnoDB error

I am a SQL Server guy and have only recently decided to venture into the world of MySQL and have run into an issue that is preventing me from progressing :(
I have installed MariaDB and started testing the installation by running
mysqld.exe --console
and received the following error
[ERROR] InnoDB: .\ibdata1 can't be opened in read-write mode
I have done quite a bit of research on this and have not found a solution that works.
I have tried the following:
Checked the user permissions for the containing folder of ibdata1 which is located at C:\Program Files\MariaDB 10.1\data and everything looks correct.
I have tried deleting the ibdata1 and log files from the above location, stopping mysql and restarting.
I have tried repairing the application.
I have tried uninstalling and reinstalling.
None of these have worked.
Please let me know if you have any information that might help me.
This is on Windows 8, MariaDB version 10.1.13.
Thanks!
You're running MariaDB from the console interactively, which means you're running it under your local user account security context. I'm guessing the command-prompt window was not elevated first, so your security level will not grant you access to write to anything under %programfiles%.
There are two options:
Change your MariaDB configuration to store the file under %ALLUSERSPROFILE% (which is C:\ProgramData on Windows 8) or your local user account.
Run MariaDB as a background service with its own user-account (a service-identity, perhaps, if you're comfortable with that, otherwise a normal user account) with appropriate permissions.
Out of curiosity, why are you running Windows 8 instead of Windows 8.1?
MariaDB MSI installs datadirectory under C:\Program Files\MariaDB ...\data (not that different from SQLServer , where data directory is also under the installation root). During the installation you were asked if you want to install as service. Say "yes" to this, and then you won't need to start mysqld on the console window, it is already there, running as service.
Perhaps this service is already running , and thus second attempt to open the files (when you run mysqld --console) does not succeed.

the MySQL service on local computer started and then stopped

the MySQL service on local computer started and then stopped. Some services stop automatically if they are not in use by other services or programs.
Can anyone resolve this issue? Thanks.
After installing it by mysqld --install. Try this mysqld --initialize. We got the same problem but it's now working.
If using version 8 and you edit the my.ini I found that Notepad is putting 3 hex characters at the beginning of the my.ini file. EF BB BF. Deleting the 3 characters from the beginning of the file in a hex editor fixes the problem.
In version 8 they are accidentally putting Unicode characters in the ini file. This is causing Notepad to save the file with Byte order mark characters.
The following line in the file is the culprit "The line # range from 1 to 2^32 − 1. “Unique” means that each ID must be different." has 3 Unicode characters. This is causing notepad to append the byte order mark to the text file.
Also remember to give NETWORK SERVICE permission to the folder:
Right-click Data folder
Select Properties
Select Security tab
Click Advanced
Click Change Permissions...
Click Add...
Type NETWORK SERVICE
Click Check Names
Click OK
Select Full Control
Click OK – four times
Start MySQL service
In my case, I tried to open a DOS prompt and
go to the MySQL bin\ directory and issue the below command:
mysqld --defaults-file="C:\Program Files\MySQL\MySQL Server 5.0\my.ini" --standalone --console
And it shows me I was missing the "C:\Program Files\MySQL\MySQL Server 5.0\Uploads" folder; I built one and problem solved.
Using Community 8.0.17, upgraded from 8.0.16
There may be a more secure way of doing this, but since I'm just running a dev box:
navigate to the \data folder
make SURE the \data folder is EMPTY. If files exist the --initialize option will fail
give SYSTEM Full Control permissions on the \data folder
go back to your command prompt
run mysqld --initialize
you should see all of the required data file structures in the data folder now. If they are not created, the mysqld process has contention or improper security to write into the folder correctly.
Now start your named service in whatever fashion you want (SC/NET/service.msc, etc)
Assuming all of the files were created properly by --initialize the service will start.
Open Service
Right click on MYSQL service
select Log on
check local system account
start service
This may be because of changing lower_case_table_names after a server has been already initialized.
From the docs:
lower_case_table_names can only be configured when initializing the
server. Changing the lower_case_table_names setting after the server
is initialized is prohibited.
The solution to this problem is to set lower_case_table_names parameter at server installation as described in the following answer:
Can't set lower_case_table_names in MySQL 8.x on Windows 10
I see this error when I install MySQL 8.x, edit the max_allowed_packet in the my.ini file, and then restart mysql on a Windows 10 machine. My recommendation, to avoid this issue, is to edit the my.ini file in a hex editor (something like Frhed). DO NOT USE NOTEPAD. It does something to the hex layout of the .ini file.
Follow the below instruction as below to save your day:
If you modify my.ini not correct, you will find the trouble "the MySQL service on local computer started and then stopped". So you need to check your my.ini in "C:\ProgramData\MySQL\MySQL Server 8.0\my.ini" again to make sure there is no strange command. If you don't know and want to restore to original, you can search on web with key word "my.ini configuration", download the latest and copy it to "C:\ProgramData\MySQL\MySQL Server 8.0\my.ini"
For whom delete the SQL service on Window or Linux, You can follow these step below:
(Window)
Delete Current Service
You need to stop MySQL80/MySQLXX in Service before carry out the action below
Open commandLine of Window and run as administrator
sc delete mysql80 <= If you use mysql80, it will delete MySQL80 in Service
sc delete mysql <= If you use "mysql --initliaze", it will delete MySQL in Service
The command mysqld --initialize just create MySQL in Service of Window or Linux
So when you check it Path Executable, it misses my.ini so you can't use you MySQL Server although MySQL Service is working
For MySQL80
"C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe" --install MySQL80 --defaults-file="C:\ProgramData\MySQL\MySQL Server 8.0\my.ini"
For MySQLXX
"C:\Program Files\MySQL\MySQL Server X.X\bin\mysqld.exe" --install MySQLXX --defaults-file="C:\ProgramData\MySQL\MySQL Server X.X\my.ini"
=> It will create MySQLXX Service working with my.ini
Then MySQL works normally and you won't need to install your MySQL again.
I don't use Linux or Mac so I can't instruct - But you can find the answer above for reference
This problem is so complicated and depend on MySQL Version.My problem was happened on MySQL 8.0.2. When I've config my.ini file on notepad and save it.I soleved following #jhersey29 solution https://stackoverflow.com/a/55519014/1764354 but little different approch.
my solution is restore my.ini file and edit config value via Option files on WorkBench Application.
workBench Menu Example
Search for services.msc and look up through your services that are running if there is a mysql service running already other than the one you want to run (it could be xampp or wamp) or another service (for example Skype) using the same port as mysql and stop the service so you can run your mysql service.
This error happened in my case when secure-file-priv was pointing to unexistent folder, make sure it exists and readable.
The line of code example in my.ini:
secure-file-priv="D:/MySQL/uploads"
Nothing was working for me but then I checked here. I ran that command qc sc mysql57 and copied the value of BINARY_PATH_NAME from it. After that I checked this and changed the value of lower_case_table_names from 0 to 2 in my.ini file. Then in the command prompt, I ran this command - << BINARY_PATH_NAME >> --install-manual. After that, I started the MySQL57 service and it worked.
You also might have accidentally added some wrong text in my.ini file. Make sure no invalid character is added at the beginning of the file.
Rename or delete the folder under,
C:\ProgramData\MySQL\MySQL Server 5.7
folder name change as per your MYSQL version number.
I had this issue after my database was working fine for long time. It turned out it was some data corruption.
In the error log I had:
2017-02-07T10:11:42.270567Z 0 [ERROR] InnoDB: Ignoring the redo log due to missing MLOG_CHECKPOINT between the checkpoint 44002250712 and the end 44002250240.
2017-02-07T10:11:42.270606Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2017-02-07T10:11:42.577436Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2017-02-07T10:11:42.577470Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2017-02-07T10:11:42.577484Z 0 [ERROR] Failed to initialize plugins.
2017-02-07T10:11:42.577488Z 0 [ERROR] Aborting
Then I had to delete the 2 ib_logfile* files, and it restarted again.
my.ini file should save as (Encoding) ANSI not UTF-8 or others files.
I have faced the same situation. I have changed the server-id=2 and when saved got this error. After a lot of research, I have found the solution.
In windows after
changing my.ini mysql configuration file, save the file as
ANSI rather than UTF-8
This has worked for me well.
another instance of mysql like 5.6 or 8 run at the same time
and the 80 port was reserved
please > go to >> services>> stop all another instance >> disable them
in my case problem solved and service started as well
Changing xampp folder's permission in windows to full control for 'authenticates user' fixed my problem.
In my case, mysqld was starting and stopping with no error message. I needed to open command prompt using "Run as Administrator", and then run mysqld.
I am only doing this for temporary development. I would not recommend running MySQL as an administrator in any case.
This was the final step after the above troubleshooting.
Delete or rename the 2 following files from "C:\ProgramData\MySQL\MySQL Server 5.7\Data":
ib_logfile0
ib_logfile1
The same problem happened with me also, nothing worked... I first deleted the service (in my case MySQL80 and MySQL) by command:
sc delete MySQL80
sc delete MySql
and then reinstalled MySQL. Mine was MySQL 8.0. And then everything was back to normal.
the MySQL service on local computer started and then stopped
This Error happen when you modified my.ini in C:\ProgramData\MySQL\MySQL Server 8.0\my.ini not correct.
You can search my.ini original configuration or checking yours to make sure everything is OK
If you came across this while installing WAMP64 on Windows 10. Check if data folder in MySQL folder is missing. My WAMP 3.2.3 version installation failed to create such a folder. So wamp icon was orange (1 of 2 services running).
A quick fix was to run this command from MySQL location.
C:\wamp64\bin\mysql\mysql5.7.31\bin\
mysqld --initialize-insecure
non of the above actually works so delete mysql,reinstall mysql,restore back if any...enjoy
I had the exact same message as displayed in the question. I have tried many suggestions with little luck. I was about to install WAMP (I'm on Windows) and was about to uninstall MySql 8.0 first, when I noticed a program included in the installation: 'MySQL Installer - Community' so I tried that. With this installer I set up a new connection, added password to root, added another user with password, set my choice of locations for all logs and ran the install.
The result was that it now totally works.
Such a problem can very often come due to configuration errors.
Vivek Sethi mentioned 20th December 2012 that it is possible to get logging in the console by running the following command:
C:\Windows\system32>"C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqld" --defaults-file="C:\Program Files\MySQL\MySQL Server 5.5\my.ini" --standalone --console
Right-clicking on my service in Windows 10, I recognized the --defaults-file= parameter, and with console logging I was able to see what was wrong in my configuration. In my case the path to datadir= and secure-file-priv= was wrong. I hope others can be empowered as well by being able to see logging details in the console. Good luck!
make sure your data folder is fully empty before use command mysqld --initialize
Go to "C:\ProgramData\MySQL\MySQL Server 8.0\Data\[machine name].err" and check the last rows - it should tell you why it failed. In my case it was duplicated tablespace id between databases.
It looks like this:
2021-09-12T05:19:22.815152Z 0 [Warning] [MY-010915] [Server] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2021-09-12T05:19:22.818357Z 0 [System] [MY-010116] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe (mysqld 8.0.22) starting as process 30664
2021-09-12T05:19:22.866774Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-09-12T05:19:22.908983Z 1 [ERROR] [MY-012209] [InnoDB] Multiple files found for the same tablespace ID:
2021-09-12T05:19:22.911667Z 1 [ERROR] [MY-012202] [InnoDB] Tablespace ID: 124 = ['db1\accounts.ibd', 'db2\accounts.ibd']
2021-09-12T05:19:22.915514Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Failed, retry may succeed.
2021-09-12T05:19:22.918627Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2021-09-12T05:19:22.927714Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2021-09-12T05:19:22.930912Z 0 [ERROR] [MY-010119] [Server] Aborting
2021-09-12T05:19:22.934432Z 0 [System] [MY-010910] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe: Shutdown complete (mysqld 8.0.22) MySQL Community Server - GPL.

Errors with MySQL 5.7 installation on Mac OS X El Capitan

I need some help here to understand installing and initializing MySQL on my local Macbook. First I have installed MySQL using the DMG file and everything looks like it worked fine. I even tried doing some basic hello-world type of activities on the database to get a feel of it.
Then next I came across this page in the documentation that explained the process of initializing the data directory. I got really puzzled, and just decided to uninstall MySQL following the instructions here and go through the whole installation process again. My goal for doing so was so that I could follow the initialization instructions as stated in the documentation before I started using the database, unlike in the first time round, where I started using it before I had initialized.
I found the process of initialization to be quite tricky and confusing. As I was at the step running the command
shell> bin/mysqld --initialize --user=mysql
the errors popped up
2016-01-17T17:28:21.145457Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-01-17T17:28:21.162124Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting.
2016-01-17T17:28:21.162188Z 0 [ERROR] Aborting
and then I another part of the documentation entitled Initializing the Data Directory Manually Using mysql, that accounted for this error and actually said:
If a data directory exists and is not empty (that is, it contains files or >subdirectories), the server exits after producing an error message:
[ERROR] --initialize specified but the data directory exists. Aborting.
In this case, remove or rename the data directory and try again.
As of MySQL 5.7.11, an existing data directory is permitted to be nonempty >if every entry either has a name that begins with a period (.) or is named >using an --ignore-db-dir option.
So that was what I did and I could proceed with the initialization. After that I continued with starting up the server normally,
After you initialize the data directory by starting the server with -->initialize or --initialize-insecure, start the server normally (that is, >without either of those options) and assign the 'root'#'localhost' account >a new password:
a sequence of steps I shall not quote here
and finished up the rest of the instructions in the docs, and then shutting down the server.
But I realized then the dedicated MySQL pane in the System Preferences of my Mac, which shows whether or not MySQL server is running or not, still showed that MySQL Server Instance was still running. It reminded me of the possibility that I perhaps I did not do enough to have removed the MySQL pane from System Preferences, and what I was seeing was a ghost from my first installation. I wanted to eliminate that, so I went through the whole process, uninstalling and the installing from DMG and initializing MySQL again. But this time, when I try running the server, I get a new error :
Kohs-MacBook-Pro:mysql Kohaugustine$ sudo bin/mysqld_safe --user=mysql &
[2] 15041
Kohs-MacBook-Pro:mysql Kohaugustine$ 160117 11:52:56 mysqld_safe Logging to '/usr/local/mysql-5.7.10-osx10.9-x86_64/data/Kohs-MacBook-Pro.local.err'.
160117 11:52:56 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql-5.7.10-osx10.9-x86_64/data
160117 11:52:58 mysqld_safe mysqld from pid file /usr/local/mysql-5.7.10-osx10.9-x86_64/data/Kohs-MacBook-Pro.local.pid ended
And right now, MySQL server just refuses to startup, no matter how many times I try. Not even when I do it using the GUI through the System Preferences, clicking on Start MySQL Server icon has literally no effect.
I don't know what to do right now, and would greatly appreciate any help on this!
All this just really puzzles me, and I also have the following questions for which any answers on will be of great help:
Why was the data directory already created upon the automated installation from the DMG file? Did the DMG installation also do an initialization already? In that case, then why does the docs still tell us to initialize our installation?
Is the method of uninstalling MySQL that I followed from the instructions I have posted above correct? Does this procedure of uninstallation actually remove MySQL pane from System Preferences?
Its been pretty frustrating trying to install MySQL, but perhaps this has to do with my overall inexperience with databases in general.
Thank you very much.
MySQL could be shutting down because of a permissions issue with your data directory. I just ran into that problem yesterday. Try the following command:
sudo chown -R mysql /usr/local/mysql-5.7.10-osx10.9-x86_64/data
This will change the owner of the data directory to match the user that you're using to run the MySQL daemon. For what it's worth, on my Macbook (Yosemite, MySQL 5.5), the user is "_mysql" instead of "mysql". So you should double-check that.
As for your other questions...
I believe the data directory comes as part of the MySQL package that you download. MySQL keeps information about itself in several MySQL databases. Those databases should be in the data directory when you do a fresh install.
I haven't tried uninstalling MySQL yet, but the steps look like they should work. Specifically, the line about removing files from the PreferencePanes folder should remove the MySQL pane from System Preferences (following a reboot). The bits containing:
sudo rm -rf .../my*
make me a little uneasy though.
Do you have any *nix experience? I think that would help you more than familiarity with databases in this particular case, as you're going under the bright candy shell of OS X and getting into the dark, chocolaty center that is BSD Unix.
Hope this helps. Good luck!

Mysql service wont start on windows 2008 server r1

About a month ago, after I changed a startup parameter on mysql administrator, my server got frozen. So I rebooted. Ever since my mysql service wont start on startup or when I try to start it manually. I can only start mysql in console mode (mysqld --console).
I have tried many things but none of them worked:
I have uninstalled and rebooted the server and then installed again;
I have deleted everything in program files folder related to mysql and installed again
I have deleted all the related files in programdata folder
I have treid to use 3307 port instead of 3306 but still not worked
Now when I install mysql again it can never manage to start the service during the setup procccess, so it never manages to end of installation. But I can still start the mysql server on command line with "mysqld --console"
I tried to look into the event lgo , the only error I see is plugin federated is disabled, I looked for solutitions about this error but none worked for me. I believe this might be something abput windows. Any help appreciated.
Uninstall, delete and all the cleanup you did above.
Additionaly manually delete MySQL Windows service.
This can be done by command line using sc stop MySQL then sc delete MySQL.
Before installing, a reboot shouldn't be necessary.
Recreating the Windows service manually, if the installer doesn't do it for you, can be done using "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld" --install (as the manual says).
If the MySQL installer has installed the service with on demand start-up type, you can edit to start automatically at boot using: sc config MySQL start= auto (the white space after the = sign is intentional and needed). Afterwards you can start the service using sc start MySQL.