Questions tagged as ['sql']

Database language for managing data in relational database management systems (RDBMS). Note that each database implements SQL with slight variations. Please remember to tag with your specific database as well, e.g. [mysql], [postgres], [mssql], or [oracle].
Score: 0
James avatar
SQL Server 2014 enterprise edition suddenly stop accepting the connections
us flag

We are seeing that our server will suddenly stop accepting new connection from SQL Server. The server itself is still accessible via RDP, but sharepoint portal/SSMS and any other remote SQL connection will timeout. Configuration manager shows that SQL Services are running, but if you attempt to stop/ restart the services manually, it will hang. Restarting the server will sometimes let the services go ba ...

Score: 0
James avatar
error 17054 severity 16 state 1 sql server 2014 enterprise edition
us flag

Our new database is just inaccessible. I have tried to find it in the error log and find this error during that time. So when we went to the Configuration manager. we were seeing Browser service, SQL Agent, and SQL Server services were stopped, and then tried to restart it just hung and because of that, I have to do a reboot. It is a production server and this is a recurring issue. It happened a month a ...

Score: -1
Kumas avatar
SQL - How to avoid reading value from XML column due to performance issue
mx flag

I am new to SQL , could you please suggest me how do I improve below SQL code, I have observed using SQL profiler - XML reading operation is taking too much of time.

Kindly let me know how do I rewrite the below code, so that I can see improvement in the performance.

Here - edata is the XML Column And below code is part of my main stored procedure , only below code is having an issue with performanc ...

Score: 0
gandarrillas avatar
AWS RDS Mysql 8.0 instance tables appear to be deleted
in flag

I connect to the production database and launch "SHOW TABLES" command, and the response is "Empty set". I never launch a DROP table command on this database.

Database log shows this message: "Storage size 999 GB is approaching the maximum storage threshold 1000 GB. Increase the maximum storage threshold."

The metric "Free Storage Space" shows that disk storage space is the same as before, so it look ...

Score: 0
Mariadb legacy support
cn flag

I have old version of php site, which uses unescaped 'row_number' column number in its sql queries. It seems in the new version of mariadb there has been new function called "row_number()" added and thus the queries fail. To refactor the whole project is out of the question. Also I don't want to dockerize the whole thing with older version of mariadb. Is there a way to use new mariadb but also use olde ...

Score: 0
Sahasrar avatar
Why my simple searching query is too slow?
ru flag

I don't know why searching in my "cities" table is so slow. My query looking for a table "cities" located about 25km from the city. I use this simple query and the database takes almost 20 seconds to return results.

SELECT city_destination,distance FROM cities WHERE city_start='Wien' AND distance <= 25 ORDER BY distance ASC

Table engine is InnoDB. The table has approx. 7 millions of rows:

+--- ...
Score: 0
AGK avatar
Can't install/uninstall SQL Server
sn flag
AGK

When I try to install SQL Server Express I got this error

Unable to install SQL Server (setup.exe)

Then I'm trying to uninstall everything related to the SQL server to avoid previous installation files, but I can't delete 1 folder (see image below)

inlined

Score: 0
Adding a security certificate to a remote sql server
kz flag

I'm in the process of trying to add a security certificate to a sql server running on a remote machine. I managed to generate the cert, but I'm a bit lost on the next step. All the instructions I have found assume local access to the machine running the sql server instance. Does anyone know of instructions for how to do it remotely? Is what I want to do even possible?

Score: -1
Unable to find user account to set permissions for private key
kz flag

I'm trying to set up a security certificate for a sql server. According to the documentation, I need to set up the permissions so that the sql server instance can read the private key. I tried setting up the permissions through mmc (see https://stackoverflow.com/questions/36830411/how-can-i-give-sql-server-permission-to-read-my-ssl-key). I right click on the cert, select 'all tasks', select 'manage pri ...

Score: 0
R2Bleep2 avatar
Can I move my encryption key (used for SQL always encrypted) from a key vault in one Azure tenant to another?
us flag

We have migrated a database (backup to .bacpac and restore to the new tenant) but the database was encrypted using always encrypted and the key is stored in the original tenant's key vault. I can look at the data in SQL management studio by authenticating with the first tenant when it tries to decrypt (it automatically pops up the authentication dialog), but I need to move the key so my web app can acce ...

Score: 1
mikef0x avatar
restrict access to a specific URL with .htaccess
vn flag

Hello i am running server with xenforo. i would like to know how can i restrict url from .htaccess.

Url is : https://mywebiste.com/index.php?members/find&q=oi%5Bp%5C&_xfRequestUri=%2Findex.php%3Fmembers%2F&_xfWithData=1&_xfToken=1648216864%2C89d40e7bf50a91b8a62f9fe448c5d1f3&_xfResponseType=json

there is sql injection so it think just blocking it would fix it.

i tried doing someth ...

Score: 0
user3637971 avatar
How does dovecot performs the hash comparison process without using salt in password
ve flag

I got a mail server using dovecot, postfix with mysql

I insert an email user through the following sql statement:

insert into users(email, password) values('dave@example.com',ENCRYPT('secret'))

Besides, the file /etc/dovecot/dovecot-sql.conf.ext contains:

driver = mysql
connect = host=127.0.0.1 port=3306 dbname=mail user=mail_admin password=password
default_pass_scheme = CRYPT
password_query = SELEC ...
Score: 0
Vanillaice avatar
How do I use the pgpass.conf file to allow promptless connection to a database
us flag

for testing purposes I have a postgres service/database running on my local computer. Right now I am using a batch file to change default userlogin, but I cannot use SET PGPASSWORD to pass along a password.

start cmd /k "chcp 1252 & SET PGUSER=postgres"

With this I just have to type 'psql' into my CMD without the -U postgres flag. As I understand PGPASSWORD was depreciated so the correct way  ...

Score: 1
CloudSysPro avatar
SQL Database restore to different edition?
cn flag

I have SQL server 2008 R2 standard in house server and want to move my database to SQL 2019 Web edition in VM in AWS cloud. Can I just backup database and restore it there? would that work? or standard edition can only be restored to standard not web edition? Database is not that big, under 30GB.

Your help would be highly appreciated.

Thanks

Score: 0
DevPy avatar
Monitor local SQL Server traffic
us flag

I am running a local instance of MS SQL server 2014 Developer Edition, I enabled the certificate based encryption on it, so I want to verify that all the incoming and outgoing traffic is encrypted. I used Wireshark for that, but suddenly Wireshark stop showing the traffic of the SQL server. Furthermore, I uninstalled and reinstalled the SQL server may cause the issue. Am I missing any configurations tha ...

Score: 0
Can't connect to sql server by instance name
ca flag

I have a user 'user_1' requesting access to sql server 'server1'. The user_1 is in domain 'domain1' and the sql server 'server1' is in domain2.

After I granted the user with permission, he found he couldn't connect to the server using name 'server1'. Instead, he has to connect using the name 'server1.domain2' (its FQDN).

I myself have no problem connecting to the server using either instance name on ...

Score: 1
woodyboow avatar
How to create a new user with sysadmin privilege in Azure SQL Server?
tr flag

I need to create a new user with sysadmin privilege.

I went to the Azure portal > Query Editor. Then I run this commands.

Unfortunately I got this error:

enter image description here

Any help is welcome.

Score: 0
Export "Failed to export: Internal error encountered."
in flag

I am receiving an error when trying to export and save a query to a CSV (Google Drive) sheet.

The error "Failed to export: Internal error encountered."

Score: 1
Andy White avatar
MySQL is 100% CPU over the past week, no idea why, details below
cn flag

I'm trying to work out why MySQL is hitting 100% over the past week:

https://i.imgur.com/NQH5dR0.png

It's a server that does network/server monitoring called LibreNMS.

Top: https://pastebin.com/1qypfm0n

Here I access MySQL and look at the processes: https://pastebin.com/zCVMh2cL

and full processes https://pastebin.com/0ZFhqpiF

I then found a tool called MySQLTuner, but I'm not experienced enough to understand the results: http ...

Score: 0
fajin yu avatar
Why can't I grant select privileges to all table in schema with PostgreSQL?
in flag

I have a database my_database, and it have some tables named my_table_1, my_table_2, ... , my_table_128 under schema public. I need to grant select privileges for all tables in schema public to user my_db_user, so I execute SQL command below:

GRANT SELECT ON ALL TABLES IN SCHEMA public to my_db_user;

And it executed without error. But after I connect with user my_db_user and tried to select somethin ...

Score: 0
HadiB avatar
I have a sql server with a pictures table with 25 million entries and it has become too slow to query. currently have a xeon E5-2667v3 with 32g of ram
fr flag

I have a sql server with a pictures table with 25 million entries and it has become too slow to query i currently have a Xeon E5-2667v3 with 32g of ram, I am looking to get a hp ProLiant Gen 9 and I am not sure how to go with specs, is SQL single or multi-threaded? would I benefit from going many weaker cores or less stronger cores? does ram have a large effect? should I get more ram or faster ram? What ...

Score: 1
Does NT SERVICE\MSSQLSERVER require Kerberos authentication if the sql instance is on the local machine?
sg flag

I had a bizarre issue today where NT SERVICE\MSSQLSERVER was being denied login as a service on a domain joined computer. I also noticed group policy was not being applied via gpupdate /force. I disconnected the computer from the domain, deleted the AD Object, re-created the AD Object, and re-joined the domain. The computer pulled policy successfully, and SQL Express worked. I know the GPO's don't have  ...

Score: 2
ChimpyMonk75 avatar
MYSQL is at 197% CPU usage ~ not allowing site to run
cn flag

Spec: 8 GB memory / 4 vCPUs / 25 GB ssd

Ubuntu 20.04

My website got hit with a DDoS recently and had this continuous high CPU usage error for 4 days and the site will not load up, I take a look using top -c and it showed 200% CPU usage. I tried SQL tuner but I did not see any significant differences and my site is not able to load up

MySQL Tuner:

 >>  MySQLTuner 1.8.5 - Major Hayden <maj ...
Score: 0
ARaj123 avatar
Extracting encoded SQL attack statements from IIS/Apache Logs
ng flag

I'm working on a cybersecurity application and one of its features is machine learning to detect SQL injection attacks. I'm in the research phase right now and I'm looking at data collection and preprocessing. So far I've been able to write a script to extract recognizable SQL statements from Apache logs.

I started looking into implementing something similar for IIS logs and I stumbled across an  ...

Score: 0
Rich Vieira avatar
SQL Server 2016 Log Shipping and Transaction Replication
us flag

Good Morning, I have a SQL Server 2016 that is doing Log Shipping to a DR Site. I currently want to also to Replicate (Transactional) specific Tables to another Server for Reporting Purposes.

Will there be any issues or snafu's I should be aware of? Can I have Log Shipping and Transactional Replication configured on the same Publishing Database?

Score: 0
thexbuttonisntworking avatar
Error 258 when connecting to sql server instance over the network
cn flag

Can't connect to a sql server instance over the network, and all SSMS gives me is a 258 error.

Everything is supposed to be correct.

  1. Both machines are inside a domain and the user was added to the security\logins during installation.
  2. Server Authentication is set to "SQL Server and Windows Authentication mode"
  3. Firewall has the following ports open: 1433, 1434, 4022, 135, 2383, & 2382 TCP, and ...
Score: 0
Randy avatar
sp_send_dbmail succeding but sometimes failing
in flag

Also posted in Stack Overflow. Any feed back would be much appreciated.

I have a need for a SQL job to send multiple emails, and I have come across this error that I am unable to find any solutions for. When I send emails this way is succeeds every time I have tested.

EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'AzureManagedInstance_dbmail_profile',
@recipients = '*Valid Email Address*',
@body = 'tes ...
Score: 0
Someone2 avatar
Rolling Backups of .sql files
in flag

I'm having a bunch of docker-containers containing different databases. For every container there is a Jenkins-Job which performs a daily backup of the database as a .sql-file and then zips this file. As you can imagine this leads to a lot of redundant data over time:

-rw-r--r--. 1 admin admin 103475967 30. Aug 02:15 20210830021501_all-databases.sql.gz
-rw-r--r--. 1 admin admin 103475967 31. Aug 02 ...
Score: 0
Tish17 avatar
Oracle SQL command without input prompt
lk flag

In Oracle Database I need to execute SQL command RECOVER DATABASE UNTIL CANCEL BACKUP CONTROLFILE;. After that I got input prompt. I should enter CANCEL. Is there a way to enter only one command with automatic CANCEL substitution? Thank you for your answers!

Score: 0
gfsadmin avatar
SQL Converting strings to date
us flag

this has really baffled me for a few days and am seeking help. I am using SQL Server 2017.

I am trying to handle strings from a free format field and either convert them to a date in the format of "dd/mm/yyyy" or if they are not in this format then simply display the text verbatim.

I need this in a VIEW so can not use SET LANGUAGE. Sounds simple using convert and isdate but does not seem to work.

 ...