In order to optimize the operating points of the dissolved oxygen concentration and the nitrate level in a wastewater treatment plant (WWTP) benchmark, a data-driven adaptive optimal controller (DDAOC) based on adaptive dynamical programming is proposed. This DDAOC consists of an evaluation module and an optimization module. When a certain group of operating points is given, first the evaluation module estimates the energy consumption and the effluent quality in the future under this policy, and then the optimization module adjusts the operating points according to the evaluation result generated by the evaluation module. The optimal operating points will be found gradually as this process continues repeatedly. During the optimization, only the input–output data measured from the plant are needed, while a mechanistic model is unnecessary. The DDAOC is tested and evaluated on BSM1 (Benchmark Simulation Model No.1), and its performance is compared to the performance of a proportional-integral-derivative (PID) controller with fixed operating points under the full range of operating conditions. The results show that DDAOC can reduce the energy consumption significantly.