Is there is way to send email when query executed manually in mysql server. Can we do this in mysql trigger please advise me how do we get email when some query run in mysql
please don't try to do that...
MySQL is a pure Database it's not its business to send eMails.
MySQL has no eMail functionality ether.
i'd recommend creating a new table and write a tuple in that table when the procedure is used.
Then poll that table (with a java application or so) and send the mail
MySQL is just a database solution, where you can store and retrieve data. For query, you may use a server side scripting like PHP. Then using php, while doing a query, you may send emails. Set up email in your server to send to an id while mysql data is retrieved.
Related
I have 2 rest APIs the first one will return an id I can use to get more data from the second one. I want to push the result of the second api to my sql database in phpMyAdmin. what is the best way to do this? should I be writing a script in another programming language? I plan on pushing at least a hundred results.
What language do you use to interact with your rest APIs? Assuming it is a server-side language of some sort, such as PHP, then you would create a database connection in PHP (look up PDO, MySQLi), then you could write a MySQL command such as INSERT INTO to write your data to the MySQL Database.
PHPMyAdmin plays no role, except that it gives you web-based database management for doing things manually (such as view, write, modify, etc).
I want the application to be notified when the database is changed.
I can't use trigger. Because we know the DB's connection message, but we can't modify the db.
So can anyway make application be notified by a connection, like oracle JDBC's Database Change Notification.
So can anyway make application be notified by a connection?
No.
There is a user-defined extension you could use, if you control your MySQL server, to send messages (amqp) from MySQL. You can use that extension in a trigger. https://github.com/mysqludf/lib_mysqludf_stomp#readme
Otherwise, you are out of luck on this. You need to add this notification functionality to the code you use to INSERT and UPDATE rows in your table.
I'm having a table product in the database pascal, I'm using Mysql (Xampp) to store the database. I want to "Select * from product". I want to have ajax script that can query the sql statement and display it on a html page. I dont want to have any .php files. Can someone help me.. Thank you.
I don't think that's possible.
AJAX queries send XmlHttpRequests -- basically, messages over the HTTP protocol. And MySQL does not respond to HTTP queries. That's why you need something in-between -- PHP code would receive the HTTP message, perform the SQL operation, and return the results.
The second problem you have is that having a database which can be accessed from JavaScript is absolutely not secure. It implies that the username and password used to access it are stored in your code (which anyone can see), and it implies that it accepts connections from any source, since your JavaScript code would run on anyone's computer who is visiting the page.
I'm searching a way to send emails via MySql, similar to using dbmail in SQL Server.
I am writing a query to be emailed every week but for the life of me I cannot find any information on sending emails using only MySQL. All solutions I've come across uses php to send the actually email, which I don't think I'd want seeing as I want to schedule it to send an email every week.
Is it possible to send emails via mySQL?
Is there a better way to implement this?
Any help is appreciated.
Thanks.
Development Tools: WAMP Server, MySQL Workbench
You could create a batch/Powershell script that executes on a schedule (using the Windows scheduling assistant).
Whilst this isn't the way I'd perhaps do it (Maybe a PHP Cron Job for example) - it is certainly a way of doing it without PHP
Is there a reason you don't want to use PHP?
Thanks,
To Schedule events on MySQL you can flow this tutorial.
http://www.sitepoint.com/how-to-create-mysql-events/
To send e-mail you can use MySQL UDF (https://github.com/mysqludf)
Here is a tutorial
http://dailypaper.in/technical/how-to-send-email-from-a-mysql-trigger-in-linux/
hope this can help you
Is there any mail packages available in mysql?
I am using phpmyadmin tool to manage mysql Db.
I want to send email using stored-procedures in mysql.
No there is not and You should not do this because it can affect mysql performance.
My advice is to write a simple script that send e-mails according to data from table.