Jacks_Personal Sql
It is not secret that I am not a fan huge of databases. If it is reasonable to not use a database, I don't. This site for instance, only uses a single table with 5 columns to keep track of my posts. The content it self, is in a xml file. One file per post. And this is the way I like it. Don't get me wrong, I know in most cases a database is the perfect tool. But a lot of people go crazy over them. As if they are the cure to everything. Like php users. Who know how to do things one way and never wanna step off that one path or step outside the box.
So, it would probably come as no surprise that I have failed many times to set up a MySql server. However, this weekend. I finally figured it out. Lets walk through the process and figure out exactly why I dislike databases, shall we?
I am going to set this MySql server on a local box of mine on my network. I know what computers are connected, none of them are windows, so I am really not worried about security. If database security is important to you, find someone who actually knows what they are talking about. Do not listen to me.
Note 1: I am doing this in ubuntu, both client and server
Note 2: I will be using local dns address, ips will work just as well.
Lets start from scratch...
No problems. The version that was installed for me was 5.0.67.
We are asked to set a root password, for the sake of simplicity likes make the password 'rootpwd'. For additional simplicity, lets log in as root. We will not set up additional users.
Of course, by default MySql only allows local connections. This is practical and I have no problems with it. Since we are trying to access form another computer though, lets change that.
Change bind-address to listen to all
And restart...
Now, go back to your desktop and install mysql client. Then connect to the database. (Be sure your firewall is updated if you have one)
jacks@Desktop:~$ mysql -p -u root -h Server
ERROR 1130 (00000): Host 'Desktop.jacks.local' is not allowed to connect to this MySQL server
So what the hell is this now? So not only does it only listen to the loopback by default, it also wont accept anything from any other hosts. What is the purpose of this redundancy?
I have a quick and dirty fix, but lets pretend we want to play by mysql's rules. So we need to grant permission to be connected to by our desktop. Go back to your server and login to mysql. Then grant all permissions
mysql> grant all on *.* to 'root'@'Desktop.jacks.local';
Query OK, 0 rows affected (0.00 sec)
Then we go back to our desktop/client and...
ERROR 1045 (28000): Access denied for user 'root'@'Desktop.jacks.local' (using password: YES)
What?!?! The username and password are fine. I tired them over and over again. And they work just fine logging in from the server. So why is it giving us a generic access denied??? Instead of trying to figure this out, lets just bypass it all togeather. On the server edit your config file...
Insert this anywhere... (I put it in the fine tuning section)
Restart. And login from desktop.
jacks@Desktop:~$ mysql -p -u root -h Server
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 28
Server version: 5.0.67-0ubuntu6 (Ubuntu)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
And everything works just fine. Why did does this have to be so damn complicated? Why can't you just login out of the box? Oh well, at least I figured out how to disable security features. And in the end thats all that the consumer wants to do.
