Where is the database for Drupal 7 - mysql

I' am on the learning process of Drupal 7. When installing Drupal 7 I have used MySQLI database option, where it didn't ask me any information about my database. After installation was complete. I went to my Database to check if database was automatically created, it wasn't.
I wanted to know where and how does Drupal 7 uses database.

Drupal configuration files is normally located in:
sites/default/settings.php
Which gets populated during installation process (usually copied from default.settings.php). In regards to the database - you need to create one beforehand (if you start a new project). Please, refer to INSTALL.txt in the root of Drupal package. There is a step-by-step instruction that explains the process.
Hope it helps.

If it successfully installed there sure must be a database somewhere :) When you install Drupal 7 it will determine what database types you have available and require you to input at least the database TYPE, and NAME.
If this information was not asked of you during the installation process then there is only one thing that I can think of; the settings file already has some database settings in there.
So I suggest looking in the place already mentioned:
/yourdrupalfolder/sites/default/settings.php
And have a hunt for an array that contains all the database information.
Hopefully that file will let you understand what happened!

Related

How do I migrate a mysql database from mediawiki 1.14.0 to mediawiki 1.32.0?

Godaddy is forcing old servers offline and I have no choice but to migrate my old mediawiki service to a new server.
I had to maintain the old versions due to use of extensions which I fear are either gone or different now.
Here are the relevant versions:
Source: mediawiki 1.14.0, PHP 5.1.6 (apache2handler), MySQL 5.0.77
Target: mediawiki 1.32.0, PHP 7.2.15, MySQL 5.7.25, ICU 60.2
I have copies of all contents of /var/lib/mysql/ from the old server copied to the new one in a backup directory, and I have mysql dumps copied over too.
Is it possible to simply put the database tree from Source into Target under a different name and then modify LocalSettings.php?
If not, can the mysql dump be restored to do the job?
Extensions have changed and I will have to review hundreds of pages to check for problems.
Any advice on how to do this with the least problems is welcome.
Also, I might consider hiring a contractor to review the task and supervise my work. It would have to be someone who has done migrations of this sort before, or someone with other clear sufficient experience.
The short answer to your question is, painfully. That's about a decade's worth of changes. There isn't any magic spell that will make applying them less hard than it sounds; you'll have to import the old database, run update.php, and prepare for debugging any errors that might occur as you will be using an upgrade path that few if any people have taken before you.
Alternatively, you might export the content (maintenance/dumpBackup.php existed in 1.14) and reimport into the new wiki, and accept losing and having to recreate everything that's not content or content history (like user records).
Is it possible to simply put the database tree from Source into Target under a different name and then modify LocalSettings.php?
Yes, although I'm not sure what you win by using a different name.
I was facing a similar issue. I can only strongly recommend to read the release notes for any version carefully, especially for database changes and changes on how skins and extensions are loaded in the LocalSettings.php. For example the way the skins work change around version 1.24 IIRIC.
Also, be sure to create a renamed copy of your 1.14 LocalSettings.php and create a fresh one during the upgrade via the installer, the old one will cause a multitude of exceptions. You may also need to run the database upgrade several times.
Also make sure you move your old 1.14 wiki installation to an extra folder and upload a fresh mediawiki installation, do not just overwrite your existing files in the 1.14 one with the new mediawiki version.
In the end, I went the long route and upgraded version by version first on a local XAMPP dump, then on the server after I identified all the issues for each version upgrade, checked the release notes for each version and made the required changes to my custom skins, replaced deprecated extensions etc.
Good luck.

Where can I find my mySQL database (using locate doesn't help)?

First ever Stack Overflow post, thanks for your time. Any constructive criticism on how to post better, please just let me know. I have done a search on my query and have found similar posts, but I was unable to use the information within them to resolve my problem.
I have created a mysql database using the terminal window in my Ubuntu system (which I am also new to, having been a lifelong windows user). I used the following code in the terminal window:
$ mysql -u root -p
Then once in mysql, I did the following
CREATE DATABASE securities_master;
USE securities_master;
I created a user and tables in the database using some other code, that doesn't seem relevant here, so I won't bother posting. However, I then decided I would like to take a look at the tables in the database, so I downloaded an SQLite browser. It was at this point that I realized I could not find my database file.
I tried to find the answer on previous stack overflow posts, and tried the suggestions of:
locate sqlite
locate .db
locate .sqlite
locate securities_master
But unfortunately, none of these showed the file I was looking for. The only place I can think of would be what is called the 'root' directory in my computer, but the Ubuntu file manager system won't let me view it because it says I don't have permissions. Is this where it might be?
Could someone shed some light on where I might be able to find this file/database? I know it is definitely there because if I try to CREATE it again, I get the message that it can't because it already exists.
Thanks again.
sqlite and mysql are two different databases. You can't use sqlite on a mysql database. sqlite is a single-file database, in which users just open the file and read and write to it, while mysql is a more traditional relational database system with a server and a client, where the server manages the database (which is generally in a directory of files), while the client just connects to the server.
Where the mysql database is located my depend on your system, but it's usually in /var/lib/mysql. You can look in /etc/mysql/my.cnf for the configuration file, which should have a datadir option that refers to where the actual data for the database is stored.
You can check my.ini file to see where the data folder is located.
Usually there is a folder {mysqlDirectory}/data
MySQL data storage:
Commands.frm
Commands.myd
Commands.myi
The *.frm files contain the table definitions. Your *.myi files are MyISAM index files. Your *.myd files contain the table data.
as mentioned in the answer before mine, mysql and sqlite are two different systems.
You mention you used the cmd line mysql to create the database and then wanted to view the tables. If you're simply trying to see which table are created, in the same command line you used to Create the database you can run show tables;
If you're after a GUI for this, we'd need a bit more context. Is this ubuntu system a remote server, or are you using the desktop version?
You say you're a long time windows user, If you're using windows locally, I personally like SQLWorkbench for accessing my remote mysql servers.
EDIT: I just re-read your post and realised you're using local ubuntu desktop so me mentioning remote was silly, my bad! However, SQLWorkbench does have a ubuntu version at https://dev.mysql.com/downloads/workbench/

Deleting MySQL Connections

Topic: MySQL Connections
Specific Question: In a 2-3 week process of learning MySQL and attempting to get a Python stock info scrapping program to feed data into a MySQL schema (database, table) I’ve ended up creating a number of connections. (MySQL57, MySQL57_1,MySQL57Nov13) Even though I believe I’ve deleted the connections through Workbench, they still show up as Window services. How do I completely get rid of these beasts, both in MySQL and as Windows services?
System: Windows 8 64bit on a Xeon Ivy Bridge processor, large SSD’s, large HD’s, mucho RAM, dual X-fired video cards, ASUS Sabertooth MB (self-built a yr ago)
Software: MySQL 5.7, complete installation except for module for Visual Basic and Python3 (running 2.7). Attempting to use the above hardware as both a server & client.
Even though I did my first Fortran programming in 1964, and spent my career on Unix machines, please regard me as a newbie when it come to the jargon associated with databases and client/server communications.
Why am I asking this question? My “down the road question” will be about getting data from Python into the MySQL table, but “first things first” --- I would like to get a nice clean installation & am concerned with these connections showing up as windows services.
By the way, I’ve thoroughly scoured this site and many others but have not found any answers that fit my requirements; they’re either for a non-Windows environment, too full of jargon for me to understand, or too simplistic to be useful. Hope that didn't come across wrong :-)
TIA, Doug
You found the uninstallation command already, so let me show you how to make sure not to remove the wrong service.
Open the services management (e.g. via Start menu -> Computer -> right click -> Manage -> Services and Applications -> Services). Scroll to the MySQL server services and double click one that you want to uninstall. A dialog opens with various information about the service including a line "Path to executable:". The followoing line contains the full path to the server this service is for. You should only have one service for each of the servers. If that is not the case then you probably have to go through the registry and search for the service name and remove that key manually, until only one is left. Otherwise just use the path to run your uninstallation if that is for a server/service you don't want anymore.
My problem (as described in my original question) has been solved thanks to the comments that Michael made.
In a command prompt with admin privileges
net stop MySQL57Nov13 (service name)
to stop the service (all 3 of my services)
Note: I had cd'd to D:\Program Files\MySQL\MySQL Server 5.7\bin to run the net stop
commands. I have a hunch that the commands would have worked independent of the directory chosen
to run them from....didn't experiment further though. Likely depends on the PATH env var.
Then go to C:>
sc delete MySQL57Nov13
for all 3 services I wanted to delete
As a reference I used http://dev.mysql.com/doc/refman/5.7/en/windows-troubleshooting.html
The above was written prior to Mike's answer.
Later update: This is a *%#&!! nightmare! Obviously I deleted the key windows service (was one of MySQL57, MySQL57_1, or MySQL57Nov13). This effectively cratered the entire project ... couldn't create a new, fresh connection or anything else. So I uninstalled everything (to the best of my knowledge) using the internal MySQL Uninstall routine as opposed to Windows Program Management uninstall. Fortunately I've got no data which I have to save.
I'll start a new question later today.... I'm going to uninstall the mess again, and start from scratch (the new question will be concerning the MySQL import hanging when I tried to import a .sql file tied to a tutorial I've been watching)
Let's consider my Question solved with many thanks to Michael and Mike

Magento Module install SQL not running

I have written a module that is refusing point blank to create the tables within my mysql4-install-1.0.0.php file....but only on the live server.
The funny thing is that on my local machine (which is a mirror of the live server (i.e. identical file structure etc)) the install runs correctly and the table is created.
So based on the fact that the files are the same can I assume that it is a server configuration and or permissions problem? I have looked everywhere and I can find no problems in any of the log files (PHP, MySQL, Apache, Magento).
I can create tables ok in test scripts (using core_read/write).
Anyone see this before?
Thanks
** EDIT ** One main difference between the 2 environments is that on the live server the MySQL is remote (not localhost). The dev server is localhost. Could that cause issues?
Is the module which your install script is a part of installed on the live server? (XML file in app/etc/modules/, Module List Module for debugging.)
Is there already a record in the core_resource table for your module? If so, remove it to set your script to re-run.
If you file named correctly? The _modifyResourceDb method in app/code/core/Mage/Core/Model/Resource/Setup.php is where this file is include/run from. Read more here
Probably a permissions issue - a MySQL account used by public-facing code should have as few permissions as possible that still let it get the job done, which generally does NOT allow for creating/altering/dropping tables.
Take whatever username you're connecting to mysql with, and do:
SELECT User, Host
FROM mysql.user
WHERE User='your username here';
This will show you the user#host combos available for that particular username, then you can get actual permissions with
show grants for username#host;
Do this for the two accounts on the live and devlopment server, which will show you what permissions are missing from the live system.
In the Admin->System->Advanced section is your module present and enabled?
Did you actually unpack your module to the right space, e.g. app/code/local/yourcompany/yourmodule ?
Do you have app/etc/modules/yourmodule.xml - I believe that this could be the overlooked file giving rise to your problem.
the cache could be the culprit, if you manually deleted the core_resource row for your module in order to make the setup sql run again, you have to also flush the cache
probably a difference between dev and production servers is cache settings, that would explain why you only see this in production
For me, the issue appeared using Windows for development. Linux system is case sensitive. In my config.xml the setup section was named camelCase while the folder was named all-lowercase. Making them the same made the script run.

Silent/No User Interaction modes for MySQL installation and Configuration Wizard?

I am implementing an installer for one of our products that requires MySQL as a prerequisite. I would like to have a bootstrap program that queries the user for any information needed for any prerequisite products and our product. Once the user has entered in all the necessary information they can press next and walk away while the installation proceeds.
I know the MySQl installation has the ability to perform a silent installation since it is a Windows Installer package. Can someone provide the list of properties that I would be able to set on the command line in my call to msiexec?
Another part of the installation process is running the Configuration Wizard which is auto-launched at the end of the MySQL installation only if there is user-interaction provided. I would like to know if there are any parameters that I can pass into MySQLInstanceConfig.exe in order to configure my MySQl instance without requiring user interaction?
I look forward to your suggestions.
Try this one :
http://hamidseta.blogspot.com/2008/05/install-mysql-server-50-silently.html
See on musql foruns, I found this post on the subject.
Hope it helps.