mysql admin password change
|
|
Hi, I installed BitNami about a month ago and have been playing with it on my Windows machine (for personal use so far – it’s not on a server). Of course, I was having lots of questions so I was spending a lot of time on the mediawiki forums. Lately though, there is one issue that I can’t get resolved over there. $wgDBtype = “mysql”; i.e. the defaults used by Bitnami. But my struggle has been to simply change those $wgDBuser and password values to something else, not defaults and I haven’t been able to do that. if I do this: where stands for the bi defaults I get in response:
What can I do, anyone? All I know is that during the initial installation of Bitnami Mediawiki, I took down this piece of information “MySQL management tool I don’t know what this means, but if anyone knows what this is about and how it could help me with changing the default Bitnami username and password, I would appreciate it very much. (Just to re-iterate, I am just a user, I know nothing about “stacks”, “Web servers”, “Apache” and the like, but I am quite good at following instructions). Thanks, |
|
|
Ok, I have learned now that asterisks do “bold”, instead of showing up as asterisks. Sorry. |
|
|
Hi Al, What would you like exactly to change? The MediaWiki application admin password, the MySQL root password or the MySQL database user password? The first one is used to login to MediaWiki, and is set at installation time. The second one is used to control the MySQL server, and is the same password than the previous one. The third one is a standard password, and is used by the php application (MediaWiki) to change values in the mediawiki database. The database user (not root) can’t control other databases than the MediaWiki one. I hope this all makes sense to you :) |
|
|
Hi, Antonio. Well, I don’t want to say it “doesn’t make sense”, but I also don’t want to lie and say that it does. Like I said before, I can learn to understand things correctly if I start building from ground up, so please assume that I am ignorant of how applications such as mediawiki, mysql and apache and php really work. What I propose to do is that I state what I think about how it works and you can just tell me “right” if I am correct, or “right, but this detail is really so and so”, or “wrong, you are completely confused and this is what it is”. All these statements are based on things I think I know, and also things that I have been recently told on mediawiki forum. OK. 2) Operating system of a web server somehow uses those programs called “Apache”, “mysql”, “php” (and probably others) to know how to deal with mediawiki files. 3) Mediawiki doesn’t store stuff I type in as HTML type code, displayed as a web page, but in something called “mysql” database. 4) MySQL can be thought of as something that organizes various bits of data in an encrypted fashion. By that I mean, it’s a collection of .frm, .MYD, .MYI and .opt files that to an outside observer look like gibberish. 5) If, however, someone has a “username” and “password”, they can login into this encrypted “mysql” database and read all this information. *NB This is a question. You mention MySQL root password and MySQL database user password. Which of those two allows me to read unencrypted the mysql database and what would I need to do to login (using the tools provided during the installation of bitnami presumably)? 6) You emulate the afore-mentioned “server OS environment” by having my windows laptop run background tasks called “apache.exe” and “mysqld.exe”. —I just want to start with those and see where I am at, before I continue to make (wrong) assumptions. I guess to sum up, I would prefer to know all 3 things you mentioned: -Mediawiki application admin username/password (which I think I know, since it asked me to create those during installation -also, is it something I would see if I type in mysql -u<$wgDBuser value> -p<$wgDBpassword value> <$wgDBname value>, then input “Select * from user;” and it appears somewhere in that long list of data -MySQL Root (username/password) – you say it is used to “control MySQL server” and that the password is the same as for the above – what is the username? -MySQL database (username/password). Again, by any chance, are those the $wgDBuser and $wgDBpassword values I used above? -I also took down this info during installation – and I need help understanding what it about: “MySQL management tool phpMyAdmin password is:, username is <also security deleting value this for>”. Are those useful for something? Thanks a lot, |
|
|
Now it decided to italicize the end of my previous post…I thought italics only happened if you did the two underscore characters like this |
|
|
Not only that but it completely mixed up the order of words between the two corner brackets and got rid of the one next to “password is:” entirely! |
|
|
First of all, let’s clarify some points :)
You can find this all information, and a lot more, at the Wikipedia 1) More or less, yes. 2,3) Right. 4) MySQL is a program to create, control and query databases. Have a look at http://en.wikipedia.org/wiki/Database 5) Yes. The ‘root’ user is the administrator, he can do anything he wants to any database. Apart from that, you can (and should, because it’s more secure) setup other user(s) and give some permissions to them (for example, modify the contents of a certain database, but not be able to delete it). In a BitNami installation a root user is created (with the password you enter), and so another user is created only to be able to control the database. This user is the one who is configured in the ‘LocalSettings.php’ file to use the database.
Both of them can. It’s adviced to use the bitnami user instead of the root one, because that way you only can modify the mediawiki database and it’s impossible to mess mysql configuration up :) There’s an utility called PhpMyAdmin used to control the database through a web page. You can use it by entering http://localhost/phpmyadmin You will be asked for a password, also set at installation time. Bear in mind that installing phpmyadmin is optional during installation, so maybe you didn’t install it. 6) More or less, yes. Answering your questions: - Yes, this is set at installation time. - The username is root. - Yes, but you can also log in as ‘root’. - As I said, PhpMyAdmin is a web application (like MediaWiki is) used to control the databases. Cheers, |
|
|
Thanks, it did clarify a lot of questions for me. (And it’s amazing that I didn’t get anything totally wrong.) It’s going to take some time to digest, and I might ask some more clarifying questions later. Anyway, now that I think I understand the basics, here are two things I really need and nobody at the mediawiki forum managed to provide me with the answers yet, perhaps you might know. First of all, I wanted to learn how to back up my “Database” i.e. all the wiki pages that I create – I would like to be able to install another instance of mediawiki on another machine and move it all there. So, this is one thing. Ability to “Export” my database, and “import” it into a virgin installation of medaiwiki. Another thing came up when, in the course of discussion I posted some values from LocalSettings.php file, including $wgDBuser and $wgDBpassword. Those were promptly deleted by the administartor (as we both know, they were “bitnami”) and I was told that I have just given open access to my mediawiki (i.e. mysql database) to whoever wants it. Anyway, it all boiled down to them trying to tell me that I should change the password and stuff, and I realized I don’t know the first thing about how to do it. I tried some of the suggestions using mysqladmin, but to no avail. So, while I am probably ok right now, but since later on I might like to try installing mediawiki on an actual server so that people in my company can access it remotely, it would be nice to learn about all this. So those are the two concerns at the moment and, by the way, I was actually able to login to this phpmyadmin thing now that you have explained to me how to do it. So, from what I have read, “localhost” is a way to refer to my computer as if it is a server (which it seems to be now that I have installed BitNami)? Thanks, p.s. Again, thanks for your explanation. I’ll try to learn it. |
|
|
Also, I see in this phpmyadmin page “Export”. I wanted to try exporting the database as PDF, but didn’t know how to call the file (at the bottom of the page). File name template (1): SERVER ( remember template ) Do I just click “Go”, or do I need to change SERVER to something? I just want to see what would happen, would I get all my pages exported as PDF, or something? |
|
|
To change the database user name and password, you will have to accomplish two different tasks: the easiest, change $wgDBuser and $wgDBpassword to your preferred values in ‘LocalSettings.php’. That would do it, I’ll answer to your other question in a while :) |
|
|
How to export/import Enter once again to phpmyadmin. There, you can find an ‘Export’ link, go click it. Select the ‘mediawiki_bitnami’ database, check ‘Save to file’ and click ‘Go’. You will be asked to choose a place to store the database file. Now you can safely uninstall and reinstall everything. To import the database after installing MediaWiki, go to the phpmyadmin tool (again :D) and select ‘Import’. Then, simply browse for your file and cilck ‘Go’. After that, you will have to create the database user again, the same way that I explained you in the previous post. Cheers |
|
|
Ok, cool, thanks. 1) Changing the user name and password. In LocalSettings.php I commented out the “bitnami” values and added my own. So I clicked “Go”. Next Page appeared where it said: “You added a new user”. Further down it said User ‘blah blah@%’: Edit Privileges. Well, for one thing “Global Privileges” were on the previous page also, so how does that work that the same choices are everywhere? Nevermind. On the next page I saw “Database-specific privileges”: I then did “check all” for privilege check boxes. Anyway, the result was that I had the following listed under “Privileges” in phpmyadmin: Any %—USAGE No Then 4 other usernames, which I am sure you know, with the following My questions about this are the following: b) What is this “Any” user? c) Most importantly: even though I have created a new username and password, it looks like the old bitnami user is still there, and I need to understand once and for all, does that pose a security risk for me, i.e. can somebody, as moderator of mediawiki forum was suggesting, hack into my database somehow using that username? I don’t see how, but I’d love your expert opinion on this. Thanks. 2) Exporting/Importing database I exported the database to a separate (3.4MB localhost.sql) file. a) Is it possible to export the database info so that the pages could be viewed as a PDF file somehow? b) Also, is it at all possible to stop some of the certain pages from being dumped into the sql dump file (i.e. on a different installation of mediawiki I don’t want some of my personal pages to be imported, just the ones I choose to share), or is it just easier to import and then delete everything I don’t want to show there? Or is there even a way of tagging a page in a certain manner “e.g. “private”, “public” etc) that you could have different export “templates” whereby “dumpall” would dump all the data in the database, “dumppublic” would only dump all the pages tagged as “public” etc etc? Thanks again, |
|
|
Hi Al, I’m afraid I have no idea on how to export to pdf, nor the exact use of phpmyadmin, that’s something you will have to ask at the MediaWiki forums. I think it would be safe to delete the old user, and by mediawiki\_bitnami I really meant that, at least that’s what I selected in a listbox. Cheers |
|
|
So, phpmyadmin is not something you (Bitnami – er, are you with Bitnami?) created, but a separate application like mediawiki, used to manage databases etc? Ok, I see about \ in mediawiki\_bitnami. It says in the info tip that \ should be used to “escape wildcards _ and %” – to use them literally. As I said, everything was working fine anyway, and I think it is because I had “global” under “Type” for my new username. Now, I actually added this thing called wildcard: mediawiki_bitnami to show up underneath “global” in that column, but that’s probably irrelevant. I have not removed “bitnami” user, but that’s probably ok, since under “Grant” it says “No” for this user. Thanks, |
|
|
Yes, I’m a proud member of the BitNami Team :) and no, PhpMyAdmin is not something we have developed. Its web site is located at http://www.phpmyadmin.net/ Cheers! |
