The default name of windows service which holds MySQL server instance is 'MySQL'. But MySQL 5.5 allows user to specify any name for it after installation. Now I need to know the name of MySQL windows service but I can't understand where my application should look for this name. I was trying to specially make this name unusual and then find where MySQL stored it in the system. But this unusual name was only in the services list of windows registry. my.ini, my-huge.ini, and other ini files of MySQL server does not contain information about how it's windows service is named. So where MySQL stores this name?
Windows version: 7 X86/X64, MySQL version: 5.5.
Thanks in advance.
New to MySQL, I ran into the same question. What I've done to workaround this is set the instance shared_memory_base_name to the same as the service name in the ini:
# shared_memory
shared_memory_base_name=MySQLServiceName
This make it available via the system variable ##shared_memory_base_name. I don't actually enable the shared-memory connections, just set the variable.
I haven't tried it on Linux, though maybe setting the ##socket system variable could provide the same.
I realize this is a bit late to help you now, but someone may find it useful...
It's stored in the registry. The MySQL Instance Configuration Wizard reads the registry which contains the name and also the path to the corresponded service .exe.
But I don't exactly know how to find these registry entries programmatically.
PS: The entries may can be found here:
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MySQL[xy]
(xy is the version like: 57 for 5.7)
The ServiceName is stored here in the key "DisplayName" and the path to the .exe in "ImagePath".
Note: These path may contains start parameters like the path to the my.ini file also.
MySql variable ##pid_file contains path to the file contains proccess id of mysql instanse.
Read this value and map to the windows service.
In my c# code:
public static string GetServiceNameFromPid(uint pid)
{
string result = null;
var searcher = new System.Management.ManagementObjectSearcher($"SELECT NAME FROM WIN32_SERVICE WHERE PROCESSID = {pid}");
foreach (var managementBaseObject in searcher.Get()){
if (result != null){
throw new InvalidOperationException("PID correspond two or above service name");
}
result =(string) managementBaseObject["NAME"];
}
return result;
}
MySQL does not need to store this name anywhere. The server process gets launched by Windows service controller, and the client communicates with the server via the network, so it does not need to know the name either. As you discovered, the only place this will appear is in the services list in the registry. Consider that on Linux, daemon processes don't have special names the way Windows services do. The service name is an artifact of running on Windows, and MySQL doesn't know or care about it.
Related
I'm trying to do school JAVA EE project and I have to connect schema made in mysql from MYSql.
part of code is (for SQL select) :
String dbURL = "";
String user = "root";
String password = "root";
and i apperently have no URL somehow
Any ideas on that? I'm new to SQL and JAVA EE so i face lots of problems :/
First of all you need a running mysql instance. There are 2 possibilities :
(1) You need the domain :
local instance / domain : localhost
Remote instance / domain or IP
(2) You need the port of the mysql server instance
Default is 3306
(3) The name of the database you want to connect to.
Lets say you need to connect to the database test
Now in order to connect to the database you will need to generate the connection url. In our case since (I assume) you want to write java, the url is in jdbc format
jdbc:mysql://localhost:3306/test
In order to connect netbeans to a mysql Database you will need to follow the next steps :
Locate the service tab on the project tab and right click on the Databases.
Select the Mysql Driver and click next. (If the driver misses just download the file from the suggested portal it will be a jar).
Finally fill the appropriate information on the next frame
If you need parameters to your jdbc URL you can do so like :
jdbc:mysql://localhost:3306/test?param1=value1
You can find more detailed information on the Netbeans website : https://netbeans.org/kb/docs/ide/mysql.html
During installation of Kamailio SIP-server I run into the problem. After I Wrote /usr/local/sbin/kamdbctl create appears just ERROR: database engine not specified, please setup one in the config script. Know anyone possible reason?
Thank you very much
Change MYLIBDIR in kamdbctl to point to the path where the mysql file is available. That should allow it to find the right MySQL Engine.
One additional step i did prior was
apt-get install kamailio kamailio-mysql-modules
Defining the DBENGINE in /etc/kamailio/kamctlrc resolved an issue with the same "error message" on Debian 8 Jessie.
Hope that helps!
//Fredrik
"""
Kamctlrc
The /etc/kamailio/kamctlrc is the configuration file for kamctl and kamdbctl. You need to edit it and set the SIP_DOMAIN to your SIP service domain (or IP address if you don't have a DNS hostname associated with your SIP service).
Set also the DBENGINE to be MYSQL and adjust other setting as you want.
"""
I have done many changes in my /etc/kamailio/kamctlrc file to solve the problem but ERROR: database engine not specified, please setup one in the config script appears every time.
Then a simple thought that '#' is for comment solved the problem.
## database name (for ORACLE this is TNS name)
# DBNAME=MYSQL
Above was written in my /etc/kamailio/kamctlrc file and just removing the '#' created the database structure needed by Kamailio.
## database name (for ORACLE this is TNS name)
DBNAME=MYSQL
Just check that HASHTAG. ;)
I get this error when deploying a package to SQL 2012 SSISDB catalog:
A .NET Framework error occurred during execution user-defined routine or aggregate "deploy-project-internal":
System.Data.SqlClient.SqlException: The locale identifier (LCID) 9242 is not supported by SQL Server
......
I had a very similar issue (different LCID) and took me weeks to resolve it but I hope is the same issue you where having and it helps for any other users.
So somehow something got bad installed on the SQL Server, the service account that is setup to run the SQL Server Service doesn't have all the necessary permissions.
I tracked this issue down to a very specific procedure, try to execute on the SSISDB the procedure [catalog].[check_schema_version] and you should be getting the same error message you are getting.
If executing the procedure gives you the same error, then the soultion is going to be the same. You basically need to change the account that is running SQL Server Service (not Integration Services) to be a local admin, and change the Locale on the RegEdit for that Local Admin acccount to be the one you want.
TO do so, do the following:
Execute on Command Prompt the following to get the SID:
wmic useraccount where name='Administrator' get sid (Replace
Administrator by your Local Admin Account)
Go to RegEdit -> HKEY_USERS -> [SID Local Admin] -> Control Panel ->
International and change keys "Locale" and "LocaleName" for the
desired region,(in my case it was Locale 00000409, LocaleName en-US)
Open Windows Services, look for the SQL SERVER (MSSQLSERVER) and
change the running account to be your local admin
Restart the Service
That should be it. I figured all that out thanks to the combination of these 2 pages:
https://www.facebook.com/allaboutssis/posts/329497130467714
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/9f409937-772a-41bd-8270-7804fdd5b94e/failure-in-deploying-ssis-project-from-ssdt-to-sqlserver-2014?forum=sqlintegrationservices&prof=required
Also I had a similar issue with the LCID for the Palestinian State which was added recently to windows and it seems that the SSIS doesn't recognize this LCID. So changing the windows LCID to another one solved the problem (from contorl panel then regions)
I solved it in the following way.
First, check in Services which user SQL Server (MSSQLSERVER) runs as:
Next, open the Registry Editor and navigate to Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\. Find which ID the user has. In my case, the user MSSQLSERVER has the ID S-1-5-80-3880718306-3832830129-1677859214-2598158968-1052248003:
When you have the user's ID, in the Registry Editor, go to the path Computer\HKEY_USERS\[USER ID]\Control Panel\International. In my case, the path is Computer\HKEY_USERS\S-1-5-80-3880718306-3832830129-1677859214-2598158968-1052248003\Control Panel\International. There you will find two keys named Locale and LocaleName:
In my case, they had the following values:
Locale = 00000c00
LocaleName = en-SE
Change them to:
Locale = 00000409
LocaleName = en-US
Next, restart the service SQL Server (MSSQLSERVER).
After that, I was able to deploy the project:
when accessing database objects from other server I use [server].[database name].[schema name].object_name
but if the service name of the mssql database server is different than the default service name (i.e. MSSQLServer2008R2) then how do I access the database object? what would be the syntax?
It looks like you're confusing several different things here.
The instance name is the name you provided when you installed SQL Server. If you didn't give an instance name, then you installed a default instance that has no name. See the documentation on instances here. You can access a default instance using ServerName but to access a named instance you need to use ServerName\InstanceName.
Each instance of SQL Server has a Windows service that runs it; the name of that service is formed from the instance name by default. These are the services that you see in the Windows Services list or SQL Server Configuration Manager.
Finally, when you use four-part naming to access a database on another server, you define a linked server name when you create the linked server. The server name you give does not necessarily have to be the same as the remote server's instance name; it can be anything you like. See the documentation for sp_addlinkedserver here.
Your question seems to be asking, "what is the correct linked server name for a named instance on another server?". Example A in the documentation I linked to for sp_addlinkedserver shows how to create a linked server to a SQL Server named instance, I think that may be your real question.
I am new to the 'cloud' concept I have a Java based application for data entry which runs well on my LAN.
On my LAN I install:
MySql
Configure Instance ( user name - root, pass - ******)
Dump dummy database entry_db that is in raw format
Then I have a jar executable file which when runs, displays a login screen.
I manage to successfully log in using predefined ID and PASSWORD (user - config pass - ******)
After logging in I configure(d):
Database Type
Database IP
User Name (Root)
Password ****
Database Name ( It auto selects database named entry_db)
In another window I configure(d) Network File Sharing Location:
file shared location
image path
back up data path
config file location in xml
(Note - When I select file shared location, all other files take the same path automatically)
Then I create Admin account rather than Supervisor account or operator account and login with the Admin account and I can now upload data and distribute to all operators.
Here is my problem:
I configure a cloud computer on Hp Cloud (they provide me a static ip) and then import database from xeround.com.
I now have a dns and port number and also a log in form using MY PHP CLIENT
How can I package all this to the same executable jar file to be used from anywhere?
How can I use it just like on my LAN from the web?
What is the optimal configuration for this?
I work in Xeround.
I have read your question and I wanted to point out a couple of things; you should use the DNS in the connection string where you used to put hostname/IP of the MYSQL server machine and the port number where you used to put the MySQL default port (3306).
Other than that you can connect from anywhere there is access to the instance. I suggest that if your jar runs in the HP cloud you create your Xeround database instance there as well (this will yield improved performance).
If you still need help, we will be more than happy to help you. Just send us a quick email to support#xeround.com and we'll take it from there.
Cheers,
Yuval